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: How to start an Event when parts collide?

Previous Thread :: Next Thread 
lordrex12345 is not online. lordrex12345
Joined: 15 Oct 2008
Total Posts: 310
25 Mar 2015 09:51 PM
Hello-

So I have two parts that are gradually getting closer and closer to each other. When the two parts touch, I want something to happen. I scripted something like this in an attempt to get something to happen but alas, nothing appears, or disappears.


local Bot = script.Parent

function OnTouched()
print("Bye bye")
Bot:Destroy()
end


Bot.Touched:connect(OnTouched)


Any help is appreciated.
Thanks!
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
25 Mar 2015 09:52 PM
Touched isn't triggered if your parts are being CFramed.
Report Abuse
lordrex12345 is not online. lordrex12345
Joined: 15 Oct 2008
Total Posts: 310
25 Mar 2015 09:55 PM
Ah that's what I thought. My second question would then be if there's any alternate way to test a collision?
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
25 Mar 2015 09:57 PM
Yup, multiple ways. However I would recommend just not trying any of those ways. Instead it would be better to either move the parts some other way, such as BodyPosition.

If you move them with BodyPosition, it can be a slow sliding effect like you want, and it will not interfere with the Touched Event.
Report Abuse
lordrex12345 is not online. lordrex12345
Joined: 15 Oct 2008
Total Posts: 310
25 Mar 2015 10:36 PM
Ok I figured out what exactly you meant but now I want to make that bricks position always equal to a Moving humanoid I have programmed to Walk to certain spots. I tries using this but nothing happened:
while true do
wait(1)
game.Workspace.Part.BodyPosition.position = Vector3.new(game.Workspace.Bot1.Head.Position)
end
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