Hi, I’m trying to make a type of flight that’s similar to this:
But I’ve hit a roadblock, and that is that I don’t know how to make the reflections work well. What I was planning to do was make it so that a ray is being shot out of the HumanoidRootPart’s LookVector every 10th of a second, but then I realized that the HumanoidRootPart can’t really be rotated upwards (I tried), so if you had to bounce off the ceiling it wouldn’t work because the ray is only going forward.
A solution I haven’t tried is shooting it out of the UpperTorso, but before I do that I want to make sure that this is the most efficient way of doing it. Is there something else I should be doing, or should I continue with this? If there is something I should change, what should it be?
Edit: I’m moving the HumanoidRootPart with a BodyVelocity
--Put this in BodyVelocity
local bvPower = 100 --Number by what you multiply first flight velocity. Like - CFrame.LookVector*100 etc.
while true do
local char = script.Parent.Parent.Parent
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = char
local normal = script.Parent.Velocity.Unit*10
local raycast = workspace:Raycast(char.HumanoidRootPart.Position, normal, params)
if raycast then
local reflectedNormal = normal - (2 * normal:Dot(raycast.Normal) * raycast.Normal)
script.Parent.Velocity = reflectedNormal.Unit*bvPower
end
task.wait(0.5)
end