Keeping projectiles straight/face same direction

I wanna make my rocket face the same direction as it’s launcher or just straight, using attachments.
It keeps spawning facing right.

local Rocket = RocketName:Clone()
Rocket.Position = Tool.FirePos.WorldPosition
Rocket.Anchored = false
Rocket.Parent = workspace.__SPAWNEDSTUFF
Rocket:SetNetworkOwner(nil)
Rocket.Sound:Play()
local RS = Config.Speed
local RUPF = Config.UpF
local Vel = Instance.new("BodyVelocity")
Vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
Vel.Velocity = (Data.LookVector + Vector3.new(0,0,0)) * RS
Vel.Parent = Rocket
2 Likes

Is your attachment rotated to the right?

2 Likes

Perhaps. If I were change the orientation will it also fix the rocket?

1 Like

Yes, there might be other problems though but you should try.

1 Like

Didn’t realy fix it, still faces incorrect direction.
image

1 Like

Can you take a video? I don’t know if you mean that it turns after you fired it, or if it spawns misoriented.

1 Like

Rocket.CFrame = Tool.FirePos.WorldPosition + CFrame.LookAt(Vector3.new(), Data.LookVector)

1 Like

Surely you should rather be using a LinearVelocity instead? If you put the attachment in the front of the rocket that should rotate it correctly. Also maybe try using an AlignOrientation with the orientation of the launcher.

1 Like

It sometimes spawns misoriented, depending where you’re looking at.

1 Like

I don’t think it plays a role Data is just mouse direction and it’s used to thrust the rocket foward.

1 Like

As @TestyLike3 suggested, BodyVelocity is deprecated and should be avoided. AlignPosition or LinearVelocity should be used instead. AlignOrientation should be used to keep the orientation fixed, or you can just set the orientation at the start of launch.

the reason it isn’t rotating at all is because bodyvelocity is applied at the center of mass by default.

Vel.Velocity = Rocket.LookVector * RS

Also, yeah use VectorForce

1 Like

BV doesn’t play a role in here because when I face left the rocket spawns orientated correctly but when I face straight, it faces(the rocket) left.

How would I use AlignOrientation exactly? I have never used it before.

Try this:

Rocket.CFrame = CFrame.lookAt(Tool.FirePos.WorldPosition, workspace.CurrentCamera.CFrame.LookVector)

This is what I got.
image

Bump, Still looking for help, I’ve tried this but my rocket comes out looking the wrong direction.

Rocket.CFrame = CFrame.new(Tool.FirePos.WorldPosition, Data.LookVector) * CFrame.Angles(Tool.FirePos.WorldOrientation.X, 0, 0)
Rocket.CFrame = Tool.FirePos.WorldPosition + CFrame.LookAt(Vector3.new(), Data.LookVector)

oops i meant this

Rocket.CFrame = CFrame.LookAt(Vector3.new(), Data.LookVector)  + Tool.FirePos.WorldPosition