I am trying to make a mortar for my game and am unsure of how to angle the center to shoot the player. The speed of the projectile will always be the same when it leaves the barrel so then the mortar must angle either lower or higher to hit the player. I found this forum post on something similar, but since the direction of the projectile is decided by the angle of the center of the mortar I don’t know how to apply it. Here is the pseudo-code:
if a player exists and is within the attack range (20) studs
the base the turret will turn towards the player (I already have this)
the center of the mortar will angle so that when it shoots a projectile the projectile will hit player (I don’t have this)
Mortar - Roblox <–M Model of what I have sofar
Modeling a projectile's motion ← Article I am trying to use