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 » Scripting Helpers
Home Search
 

Re: Touched event not firing

Previous Thread :: Next Thread 
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Nov 2014 06:26 PM
--
script.Parent.Touched:connect(function(hit)
print(hit)
end)

for i = 1,1250 do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(-1, 0, 0) wait() end
--
The Touched event does not fire.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
16 Nov 2014 06:31 PM
And is there code above it that you have not included?
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Nov 2014 06:33 PM
Yes, but running that by itself doesn't function correctly.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Nov 2014 06:39 PM
I dropped a model on the part and it functioned correctly.
However, if the part (script.Parent) touches another part, it does not do anything.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Nov 2014 06:46 PM
Bump
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
16 Nov 2014 06:49 PM
Both should fire the Touched event. I still have a feeling you're halting the thread before it gets to the connection line.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Nov 2014 06:52 PM
There is no code before the connection line. Here's the code in its entirety:

--
script.Parent.Touched:connect(function(hit)
print(hit)
coroutine.resume(coroutine.create(function()
hit.BrickColor = BrickColor.new("Really black")
wait(.5)
hit:destroy()
end))
end)

for i = 1,1250 do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(-1, 0, 0) wait() end
--//
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Nov 2014 07:21 PM
Bump
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
16 Nov 2014 07:24 PM
I don't think the touched event fires if you change the cframe of an anchored part.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Nov 2014 07:25 PM
^
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Nov 2014 07:35 PM
I thought that might be it.
Any ideas for workarounds?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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