How to make an unanchored moving object not be able to get pushed

Context:
I want to make it so that an object, that is being pushed by a LinearVelocity, will not slow down when another object pushes against it (specifically a player). The object needs to be able to collided with though, just not pushed back.

Issue:
The object is getting pushed back when the player collides with it and I am not sure how to fix it. I’ve tried to set the object’s density to 100 but the object still moves back. Video Below

Thanks in advance!

1 Like

Do the walls only move in a straight line? If so just use a PrismaticConstraint and set the Force to near Max.
Or you could CFrame Tween an anchored Part and weld your unanchored walls to it.
Or try decreasing the Forces applied on your flying character. Just use enough force to make it move properly without pushing other objects.

2 Likes

Yes, they do move in a straight line but I don’t know how to use prismatic constraints.

You can check out the documentation on PrismaticConstraints here.

1 Like

As @Sepruko said, ALWAYS check create.roblox.com for tutorials.

(although when I tried using it earlier I found the Search button doesn’t work at all…
Just google it for now)

1 Like

Ok so what I understand is that it only allows an object to move on one axis, but the player is pushing the object towards that one axis so the prismatic constraint wouldn’t work unless physics can override it.

You said you don’t want the player to be able to push it.
So increase the MaxForce of the PrismaticConstraint.
If you set the ActuatorType to Servo, then use ServoMaxForce.
If you set it to Motor, use MotorMaxForce.

As long as your flying character’s forces aren’t set to superpower strength like I said before, the Prismatic forces shouldn’t stop or slow down when being pushed by the player.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.