I am trying to see what this object will touch first, if there any way i can do this?
local bv = Instance.new("BodyVelocity") -- Controls The Shot's Height Not Direction (I tested it)
bv.Parent = game.Workspace.Puck
local lesspower22 = lesspower2/2
if power >= 61 and power <= 90 then
bv.Velocity = Vector3.new(0,power / 12,0)
elseif power >= 91 then
bv.Velocity = Vector3.new(0,power / 6.5,0)
elseif power <= 60 then
bv.Velocity = Vector3.new(0,0,0)
end
bv.P = 100000000
bv.MaxForce = Vector3.new(0,1001010,0)
local power2 = power / 3.9
print(power2)
print(CFrame.new(game.Workspace.Puck.Position, mhp).LookVector * power2)
local lv = CFrame.new(game.Workspace.Puck.Position, mhp).LookVector * power2
game.Workspace.Puck.Velocity = Vector3.new(0,0,0)
game.Workspace.Puck.LastShot.Value = game.Workspace.Puck.Position
local imp = game.Workspace.Puck:ApplyImpulse(lv)
game:GetService("Debris"):AddItem(imp, power/33)
game:GetService("Debris"):AddItem(bv, power/33)
If not, could I make another object, speed it up faster than this one and see where that one goes?
You could probably raycast from the body velocity’s parent’s position in the direction of bv.MaxForce.Unit * 5000. The max ray length is 5000 so if anything is beyond that it likely wouldn’t work. Unsure as to whether or not BodyVelocity is relative to the parent part’s CFrame but if it is, you’d have to use cframe:VectorToObjectSpace(bv.MaxForce) then translate it back to world coordinates using cframe:VectorToWorldSpace for direction
Which part are you confused about? If you don’t have any raycasting knowledge you should probably check out a tutorial/introductory post. Here’s one:
It works, but how would I be able to do it with the applyimpulse as well? as this one only goes up, I am currently using bodyvelocity to lift the object and applyimpulse to move it forward