What should I put in “BP.Position” to get the model to move forward? I’m assuming lookVector won’t work because its position not CFrame.
The Position
property takes a Vector3 so the lookVector will work.
I just looked back at your original post since you want the BodyPosition to move in front of rot
you should set the BodyPosition’s Position
property to:
BP.Position = rot.CFrame.Position + (rot.CFrame.LookVector * 10);
10 is an arbitrary number to increase the distance you can use whatever depending on how far you need it to go.
This is what happened when I used your code
The stand model just disappears completely. The code itself doesn’t error.
You have to change the 10
to a larger value. I said that was an arbitrary number that defines the distance the model will go from its current position.
Weld it to the ground, it shouldn’t move unless the welds aren’t properly put together.
Any value I change it to still has the same result.
I still need the model to be able to move.
When making a stand, I use Weld.
I attach the weld to the player’s HumanoidRootPart and the stand’s HumanoidRootPart/PrimaryPart.
You would want to make all the parts on the stand Massless and Non-Collidable, that way you will not get Roblox Funni Physics.
Also make sure to not ever make the stand a Humanoid, if it is then replace the Humanoid with AnimationController.
I wouldn’t also recommend using raycast hitbox for the stand such as the hitbox you’re using right now, using Region3 as a hitbox works much better in my opinion, but the choices are yours.
(post marked for deletion for privacy reasons)
I’m just going to experiment at this point to try to find a good potential solution.
Bumping this because I still haven’t been able to find a solution.
When using bodyposition, i have some weird issues with look vector so I convert cframe to vector 3 when using bodyposition.
local BodyPosition = Instance.new("BodyPosition", PartToMove)
BodyPosition.Position = (Player.Character.PrimaryPart.CFrame * CFrame.new(0,0,-15)).Position
Apologies for the late response, i’ll use that and see if it works!
Use a BodyGyro. It basically keeps the rotation the same despite it moving. You can set the BodyGyro.CFrame through script and it will move but wont rotate (or will a bit depending on what you set as the numbers).
You can read about it here: BodyGyro | Roblox Creator Documentation
edit: You may also look into using this AlignOrientation | Roblox Creator Documentation
I think this is a more updated version of a BodyGyro, but I do not have as much experience using it.
My previous attempt of using a BodyGyro didn’t the way I intended(didn’t force model to face forward). I tried setting the BodyGyro’s CFrame to the lookVector and other methods to no avail.
This is what happened when I used your code(didn’t use a BodyGyro to stabilize due to being unable to get it to do what I wanted it to do.).
As you can see its still tumbling(like before).
I’m attempting to see if the code will work when I can get BodyGyro code working properly.
Code:
local BP = Instance.new("BodyPosition");
BP.MaxForce = Vector3.new(math.huge, 0, math.huge);
BP.P = 3000;
BP.D = 1000;
BP.Parent = rot --HumanoidRootPart of model.
BP.Position = (rot.CFrame * CFrame.new(0,0,-15)).Position
You might not have set the max force right. The default has Y at 0, and the Y value is basically horizontal rotation. Each of those is the axis of rotation.
Body forces are admittedly annoying, but with enough messing around with the numbers, I think it’s exactly what you are looking for.
edit: you may have to set the power higher as well, and mess with dampening so it doesn’t bug out.
Yeah i’m still experimenting with BodyGyros and code for it. After tweaking around with it for awhile I feel like i’m almost there so i’ll be posting a vid and code soon to show what I made.
Oh ok, idk what to do sorry I couldn’t help.