You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
Workout The Rotation Of my Arrow Projectile
- What is the issue? Include screenshots / videos if possible!
The speed of the projectile is not really a issue I haven’t worked on that yet, I’ve been trying to fix the rotation, this how it looks like without rotation since, I scraped the atan2 idea since its only gave me 1 value…
robloxapp-20220622-2343080.wmv (3.8 MB)
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have no idea how to do this, I tried using Atan2 but this only have me the X rotation, and the arrow still landed sidewards into the ground.
I also Tried converting the vectors into a cframe and use The :ToObjectSpace, however this was just unsuccessful.
This is the script I use to calculate the position of the arrow, can someone help me to add a calculation that I could return back through that function, thank you
function lerp(a, b, c)
return a + (b - a) * c
end
local Bowmodule = {}
function Bowmodule.BezierCurve(t, p0, p1, p2)
local l1 = lerp(p0, p1, t)
local l2 = lerp(p1, p2, t)
local quad = lerp(l1, l2, t)
local X = math.abs(l2.X - l1.X)
local Y = math.abs(l2.Y - l1.Y)
--local cframeRotationalDifference = CFrame.new(l1):ToObjectSpace(CFrame.new(l2))
--local newCFrame = CFrame.new(l1)*cframeRotationalDifference
return quad--, newCFrame
end
return Bowmodule
And here is how I call it
replicatedStorage.Events.RangeEvents.Fire:FireServer(tool,Fire.TimePosition/Fire.Length,tool.Handle.Position,mouse.Hit.Position)
Fire is the animationTrack of drawing the bow and Firing.