What do you want to achieve? I want a part to rotate with a parabole while it’s moving in the parabole
What solutions have you tried so far? I searched multiple posts but all of them are not what I’m looking for. (math.atan and math.atan2)
My script:
local part = Instance.new("Part", workspace)
part.Anchored = true
part.Position = Vector3.new(0, 0, -4)
while true do
while part.Position.Z <= 4 do
wait(.01)
part.Position = Vector3.new(0, -0.25 * (part.Position.Z * part.Position.Z) + 10, part.Position.Z)
part.Position = Vector3.new(0, part.Position.Y, (part.Position.Z + .1))
vectorA = Vector3.new(part.Position.X, (part.Position.Z - (part.Size.Z / 2)) * -0.25 + 10, (part.Position.Z - part.Size.Z / 2))
vectorB = Vector3.new(part.Position.X, (part.Position.Z + (part.Size.Z / 2)) * -0.25 + 10, (part.Position.Z + part.Size.Z / 2))
end
while part.Position.Z >= -4 do
wait(.01)
part.Position = Vector3.new(0, -0.25 * (part.Position.Z * part.Position.Z) + 10, part.Position.Z)
part.Position = Vector3.new(0, part.Position.Y, (part.Position.Z - .1))
vectorA = Vector3.new(part.Position.X, (part.Position.Z - (part.Size.Z / 2)) * -0.25 + 10, (part.Position.Z - part.Size.Z / 2))
vectorB = Vector3.new(part.Position.X, (part.Position.Z + (part.Size.Z / 2)) * -0.25 + 10, (part.Position.Z + part.Size.Z / 2))
end
end
The part will follow a path with the formula: -0.25 * (x * x) + 10. VectorA and VectorB are the middle of the left and right side of the part on the positions they should be to rotate with the parabole, that means if I have these 2 points I simply need to turn the difference into an angle. I just can’t seem to figure out how.
Hopefully you guys can help me out,
Mikquint