Rocket Isnt Directly going Upwards

So this is what I am using to shoot up my rocket
Script:

local Velocity = Instance.new("BodyVelocity", handle)
		Velocity.MaxForce = Vector3.new(1,1,1) * 100000;
		Velocity.Velocity = Vector3.new(1,1,1) * player.Character:WaitForChild("HumanoidRootPart").CFrame.Y * math.random(30,50) 

but instead of going directly upwards its going like this


can anyone help me?

Do you want the rocket to go straight up? Why are you multiplying by the player’s Y height? Make sure to set the values to 0 if you don’t want thoses values getting multiplied!

Velocity.Velocity = Vector3.new(0,math.random(30,50),0)

You’re multiplying all the Vector3 values by the player’s Y position number (which I don’t understand why you are doing) and then by a random value from 30 to 50, since all the vector values are one they are all going to be multiplied, causing you to have a Vector3 that looks something like this (x,x,x) when what you want is (0,x,0) hopefully that explains it!

Thanks this helped and I don’t even know why I did some things there like this I basically just used code from another script I did but yea this helped thanks

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