Projectile Range and lifespan

TosanuTosanu Member, PRO Posts: 388

I am attempting to make a weapon for a game where the ammunition will fly a fixed distance before despawning. So far, I've been tweaking velocity and a timer to destroy, but i am unsatisfied with this, as it leaves a lot to be desired for precision and requires a lot of trial and error.

I thought of having a condition in which the projectile tracks its X position compared to the player's position, (an game attribute constrained for multiple purposes) but that means the player could theoretically run after the shot and keep it traveling further than desired. If I can make this work, I can use it to adjust more than one weapon for this game. I want the shot to only travel a specific length from its own point of origin, but I cant just check position against itself. Should i, say, create an attribute that grabs its spawn X position, or would that not work due to it moving from the start? I definitely think I'm close with this, just missing something specific....

Comments

Sign In or Register to comment.