Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why Doesn't Moving a Brick With CFrame Fire the 'Touched' Event?

Asked by 9 years ago

Is there any way around this? I have a huge scanning wall that I want to move using CFrame. It is meant to go through an invisible map and turn all the parts visible using the 'Touched' event (I have the required scripts for it and it works just dropping the wall on bricks).

My problem though is it seems that if I move the wall using CFrame (.5 studs every 1 second) it doesn't fire the Touched event when it goes into the parts of the map. Does anyone know a way around this?

0
maybe you should look into region 3s aquathorn321 858 — 9y

2 answers

Log in to vote
1
Answered by 9 years ago

Touched is Physics-based
When you move a piece by CFrame, you completely bypass all of the physics.

The solution is to use GetTouchingParts to return a list of parts that it is currently intersecting with. You can loop through this to set all of the parts visible.

Ad
Log in to vote
-1
Answered by 9 years ago

Try learning a bit about BodyPosition.

CFraming parts don't do physics, I hope you get the point.

I have my own scanner which uses BodyPosition rather than CFrame. :P

Answer this question