generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Touching Part Detection Loop?

Previous Thread :: Next Thread 
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
20 May 2016 09:51 PM
I was wondering how I'd check if a part is touching another part, and to give off a true or false value depending on the answer.


~MightyDantheman
Report Abuse
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
20 May 2016 09:55 PM
I basically need it to detect is the player is touching any part, and enable a BoolValue once detected. Of course, the opposite would happen when the player is not touching anything (which would happen when the player is jumping or falling).


~MightyDantheman
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
20 May 2016 09:57 PM
http://wiki.roblox.com/index.php?title=API:Class/BasePart/Touched


helo
Report Abuse
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
20 May 2016 09:58 PM
Thank you.


~MightyDantheman
Report Abuse
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
20 May 2016 10:00 PM
Wait, how would I invert that?


~MightyDantheman
Report Abuse
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
20 May 2016 10:14 PM
I just noticed that the Humanoid comes with a Jump detection thing, but it doesn't enable when you just walk off an edge (without jumping).


~MightyDantheman
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
20 May 2016 10:41 PM
thats freefall


helo
Report Abuse
exoSentinel is not online. exoSentinel
Joined: 18 Mar 2012
Total Posts: 2795
20 May 2016 10:52 PM
local part = script.Parent
local bool = false

part.Touched:connect(function(otherPart)
bool = true
end)


Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
20 May 2016 10:56 PM
game.Workspace.Player.Humanoid.StateChanged:connect(function(state)
if state == Enum.HumanoidStateType.FreeFall then
--code
end
end)
Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
21 May 2016 12:00 AM
...what are all these suggestions? Does no one here know what TouchEnded is?

local touching = false;

-- assuming "part" is defined at the part being touched

part.Touched:connect(function()
touching = true;
end)

part.TouchEnded:connect(function()
touching = false;
end)

--do checks down here wherever you need them, just see if "touching" is true or not
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
21 May 2016 12:24 AM
I just saw that he wanted the character falling or something I didn't read the whole thread.
Report Abuse
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
21 May 2016 10:41 AM
Thanks. I never knew this function existed. I've been using the hit detection this whole time. .o.


~MightyDantheman
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image