Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can i get some help with vectors and velocity?

Asked by 3 years ago

Im trying to get my "Bul2" to go up and forward at the same time, how can i do this?


local FG = script.Parent local Handle = script.Parent local Bul = game.ServerStorage.FlareBull local function Onclick() local Bul2 = Bul:Clone() Bul2.Position = Handle.Handle.Position Bul2.Velocity = Handle.Handle.CFrame.XVector * (300) Bul2.Velocity = Handle.Handle.CFrame.YVector * (300) Bul2.Parent = workspace wait(4) Bul2.Anchored = true Bul2.ParticleEmitter.Rate = 0 Bul2.Transparency = 1 wait(10) Bul2:Destroy() end FG.Activated:Connect(Onclick)

1 answer

Log in to vote
1
Answered by 3 years ago

Do note that BasePart.Velocity takes a Vector3. Lines 08 and 09 rewrite over each other and that results in the part moving in just one direction. You should just do Vector3.new(300,300,0).

0
Then i can only shoot it one way? Hex_0517 10 — 3y
0
One way as in one direction? No, you can shoot it in any combination of directions. But you want to move 300 studs up and 300 studs to the right per second and that's just a Vector of 300,300,0. radiant_Light203 1166 — 3y
0
What you're doing in your script is that first you're making it go to the right, and then you're telling it to stop going to the right and making it go up. radiant_Light203 1166 — 3y
Ad

Answer this question