CFramed parts don't TouchEvent?
Hello, I am here just to take out an dobut that seriously intrigates me.
It's about with pure CFrame. While I was adusting an ascensor, I noticed that the Module could not detect touches with GhostPlates, then it could not update the stage where it was, so it does not know where it should stop (result, it is going up and up and up until the space.)
But we are going to go back to the example.
The Example
Let's imagine a simple example. I have two parts, one called Part1
and another called Part2
:
http://i1241.photobucket.com/albums/gg505/dav1000999/RobloxScreenShot10172015_214725602.png
The Part1
is CanCollide
and Part2
not. (Part1
is the ascensor floor and the Part2
is the GhostPlate I refered above.)
Part1
is going to move around (up and down) Part2
so it touches it multiple times. Both are Anchored
.
To move the Part1
, I have something like that:
02 | for i = 9.5 , 3.5 , - 2 / 30 do |
03 | script.Parent.CFrame = CFrame.new(script.Parent.Position.X, i, script.Parent.Position.Z) |
06 | for i = 3.5 , 9.5 , 2 / 30 do |
07 | script.Parent.CFrame = CFrame.new(script.Parent.Position.X, i, script.Parent.Position.Z) |
Simple, right? It will move the part smoothly, so it will absolutely touch the Part2
Now ill script it in order to say something onTouch.
01 | script.Parent.Touched:connect( function (h) |
02 | if h.Name = = "Part2" then |
03 | print ( "Touch. Touch. Touch." ) |
07 | coroutine.resume(coroutine.create( function () |
09 | for i = 9.5 , 3.5 , - 2 / 30 do |
10 | script.Parent.CFrame = CFrame.new(script.Parent.Position.X, i, script.Parent.Position.Z) |
13 | for i = 3.5 , 9.5 , 2 / 30 do |
14 | script.Parent.CFrame = CFrame.new(script.Parent.Position.X, i, script.Parent.Position.Z) |
Result
Nothing in the output.
Does someone understand why?