Hello,
I’m making a part in my game that reflects projectiles (makes them go in the direction of the reflector), however I’m having difficulty trying to make the projectile’s BodyVelocity go the same speed but in a different direction.
When the part hits the reflector from a different angle, its orientation will be the direction of the reflector, but the BodyVelocity’s Velocity will be faster than before… This ONLY happens when the projectile hits the reflector from a different angle
------ "BV" is the BodyVelocity. "p" is the projectile. "hit" is the reflector
local X = BV.Velocity.X
local Z = BV.Velocity.Z
if X < 0 then
X = -X
end
if Z < 0 then
Z = -Z
end
local vel = X + Z
BV.Velocity = hit.CFrame.LookVector * vel
p.Orientation = Vector3.new(p.Orientation.X,hit.Orientation.Y,p.Orientation.Z)
I know the speed increase is a cause of the X and Z adding up, increasing the speed, but I’m not sure how to fix this…