Page 1 of 1

add a way to detect projectile origin on hit

Posted: Sun Jul 05, 2026 1:29 pm
by thankedsphere2
TL;DR make projectiles store a value from their spawn that can be compared against their future states.


currently you cannot detect where a projectile came from, how long it travelled, or how long it exists. this is bad if you want to do things with this data, such as projectiles that lose or gain damage with distance


to change this, i recommend giving projectiles an age, spawn_tick, or spawn_position variable, maybe optionally added in the data phase.



a workaround is currently to compare the projectile's position to the shooter's position. this works perfectly for turrets, but is innacurate for characters.