Im trying to make a cannon that ragdolls and fires a player over a certain distance and to move the player I’m using a BodyVelocity, and making the Velocity the front of the cannon (lookvector) * math.huge. However when firing the cannon, the player moves to the right / left depending on the rotation of the cannon model.
Ive tried to change character rotation to the LookVector, but the issue is more the fact that the LookVector isn’t directly forwards and more angled than it should be.
lookAt’s second argument is the position of where the CFrame will point towards, and the LookVector of a part returns the direction, not a point in space like what you are imagining. Use lookAlong instead.
Because of this, since you are applying velocity that is the HumanoidRootPart’s LookVector, you are getting results that may be skewed. I would recommend using the cannon model’s LookVector instead.
In both cases, your character is launching to the right. Are you sure your cannon part is positioned and rotated properly? Can you send an image of what your cannon looks like along with any invisible parts.
Edit: Also try unanchoring after you create your BodyVelocity or manually setting into a ragdoll-like state. It also may be due to the fact that humanoid models will tend to stay upright when possible. Secondly, look into BodyVelocity’s alternative: LinearVelocity, as those body movers are deprecated.
This is the cannon w all parts visible - green is camera lock part, blue is the part which the character is moved to, red is hitbox.
I’m not sure what you mean positioned and rotated correctly though - it should work no matter which direction its facing because it gets the cannon front face lookvector. il try the anchoring now
Which one of these parts are your cannon parts exactly? Is it one of the invisible parts or the actual rectangle part? If it is the former, then you have to make sure that the orientation aligns with your cannon part. If it’s the latter, see if this line of code below (assuming your character is placed in front of the cannon).
As a side note, it is hard to tell from the angles provided, but is the character actually positioned dead center of your cannon part?
In the end, LookVectoris accurate, it probably just has to do something with the placement and/or orientation of the model and/or the humanoid behavior when being locked into position.