So I’m currently trying to make a projectile system with a curve system and It would have a feature where it show a prediction path similar to the game named “BedWars”.
I’ve made some code for the projectile and the curve system [They’re not that great] but couldn’t get my hands on the prediction system. Any help would be greatly appreciated.
function module.Shoot(Position1, Position2, ObjectName)
local Direction = Position2 - Position1
local Duration = math.log(1.001 + Direction.Magnitude * 0.01)
Position2 = workspace.pos.Position+ workspace.pos.AssemblyLinearVelocity * Duration
Direction = Position2 - Position1
local Force = Direction/Duration + Vector3.new(0, game.Workspace.Gravity * Duration * 0.5,0)
local Object = ObjectsThrown:FindFirstChild(ObjectName):Clone()
Object.Parent = workspace
Object.Position = Position1
Object:ApplyImpulse(Force * Object.AssemblyMass)
Object:SetNetworkOwner(nil)
end
Seems to work fine. One question though is there a possible way to not let the physics change the Orientation of the object? I want to add an Orientation tween for the gift.