Would it be possible for me to use LinearVelocity and Attachments to have an unanchored part be unaffected by physics? It is already incapable of falling because of the LinearVelocity but I am wondering if there is a way to make it work for the X and Z Axis too.
What is the issue?
I cant find a way to do this, is it even possible?
I am doing it this way because I want to use weldConstraints.
Thanks in advance.
The Part in question is a plate in a “plates of fate” kind of game I am making, as there can be events that affect the plate’s position I don’t think that would work.
I mean, I’d be able to find a way to make it work but I would like to see if it’s doable with LinearVelocitys first
I’m a bit confused by what you’re trying to achieve. If there is a LinearVelocity that can’t move on the Y axis, it shouldn’t be able to move on the X or Z axis either. Do you mean how to stop it rotating on the X and Z axis or is there another issue?
Yes, it is possible to use LinearVelocity and Attachments to make an unanchored part unaffected by physics in all directions (X, Y, and Z axes). Here’s how you can achieve this:
LinearVelocity for All Axes
You can set up multiple LinearVelocity instances to control the part’s movement along the X, Y, and Z axes. This will ensure that the part remains unaffected by external forces.
Using WeldConstraints
Since you want to use WeldConstraints, you can combine them with Linear velocity to maintain the part’s position and orientation.
You can use it somehow like this:
Attachments: Attachments are used to anchor the LinearVelocity instances to the part.
LinearVelocity Instances: Three LinearVelocity instances are created to control the part’s movement along the X, Y, and Z axes.
WeldConstraint: A WeldConstraint is used to keep the part in place relative to another part if needed.
This setup ensures that the part remains unaffected by physics in all directions while allowing you to use WeldConstraints for additional stability.
Ok i wasn’t lazy so i have made an example. I didn’t have time to test it but it should work
-- Create Attachments
local part = script.Parent
local attachment = Instance.new("Attachment", part)
-- LinearVelocity for Y Axis (to prevent falling)
local linearVelocityY = Instance.new("LinearVelocity", attachment)
linearVelocityY.VectorVelocity = Vector3.new(0, 0, 0) -- Some values but as you said you have already done this one
linearVelocityY.RelativeTo = Enum.ActuatorRelativeTo.World
linearVelocityY.Attachment0 = attachment
-- LinearVelocity for X Axis
local linearVelocityX = Instance.new("LinearVelocity", attachment)
linearVelocityX.VectorVelocity = Vector3.new(0, 0, 0) -- Some your values
linearVelocityX.RelativeTo = Enum.ActuatorRelativeTo.World
linearVelocityX.Attachment0 = attachment
-- LinearVelocity for Z Axis
local linearVelocityZ = Instance.new("LinearVelocity", attachment)
linearVelocityZ.VectorVelocity = Vector3.new(0, 0, 0) -- Some your values
linearVelocityZ.RelativeTo = Enum.ActuatorRelativeTo.World
linearVelocityZ.Attachment0 = attachment
-- WeldConstraint (if needed)
local weldConstraint = Instance.new("WeldConstraint")
weldConstraint.Part0 = part
weldConstraint.Part1 = game.Workspace.SomeOtherPart -- Replace with the part you want to weld to
weldConstraint.Parent = part