Stop a part tweening through other parts

So I want to stop the part (which is invisible and has a particle) going through other parts, in the video it has cancollide and it still just goes straight through, how can I stop this?

2 Likes

Do you mean that cancollide is set to false, or set to true?

If it’s set to false, you should be fine.

Tweening is just moving the part just like you would in studio, so I would say instead of tweening it you should use a body force, or one of those.

3 Likes

When using TweenService, parts will ignore any physics and instead will just move from the origin to the destination as if nothing is stopping it. To prevent this, you’ll have to write some custom logic.

I think the best way to go about writing custom logic for this would be raycasting. Cast a ray in the direction of movement of the object and check for any parts. Then, only tween to that position instead of going through the part.

If, instead of doing all of that you just want to use normal physics, using @Seoarro’s solution may be better for your use case.

3 Likes

Alright, I’ll give that a try. (30 characters)

1 Like

Yeah I kinda want it to just go along that top if it can’t go that way.