Hi,
Currently using a projectile movement component I would like to know how to work out how far the projectile has travelled so I can destroy it after a particular range.
Hi,
Currently using a projectile movement component I would like to know how to work out how far the projectile has travelled so I can destroy it after a particular range.
Once you fired the projectile save the start location, then in a tick function (might be the weapons tick or even the projectiles tick) check the square distance between the current location and the initial one, if it’s grater than a threshold destroy it. You should use the square distance check for comparisons because you get rid of one square root operation, you just have to remember that you have to apply the square to your threshold: 30 m will be 30^2m for the check.
Worked perfectly! Thank you!!!