Part Teleportation acting weird?
So I'm alright with lua I would say but not completely advanced and I was confused with vector3 and CFrame's but now I do know but I was testing both and my problem is the part I have here doesn't teleport correctly. When I'm not inside the coordinates of the part where it's going to teleport, it works fine. But when I am inside the coordinates the part teleport aboves me. Not sure how you would fix this and it does the same thing with a moving part that goes up and down. I put the code below.
01 | local c = script.Parent |
05 | if debounce = = true then return else |
08 | if c.Position = = Vector 3. new(- 242 , - 18 , 231 ) then |
09 | c.Position = Vector 3. new(- 243 , - 16 , 228 ) else |
10 | c.Position = Vector 3. new(- 242 , - 18 , 231 ) |
16 | script.Parent.Touched:connect(onTouch) |