#calculate life_time of projectile based on initial speed and range?
1 messages · Page 1 of 1 (latest)
velocity = distance / time, so time = distance / velocity
should be 1.6 seconds then
so if I remove delta time it kinda works but the bullet travels less when I am flying at high speeds
perceived, probably
do you mean to extend the range when player velocity is added to the bullet's?
no it should fly at the same speed and range relative to the player regardless of the players velocity
even I reach max velocity it still is shorter
unless I am not combining the velocities correctly
what i think is happening is that if the player is moving fast, the bullet will move faster
meaning that it will have reached its max range sooner (in shorter amount of time)
this isn't necessarily wrong
depends on what you want
the lifetime should be constant, right? bullet velocity relative to the player is constant
try lifetime = weapon range / weapon speed
the effective range will be larger than the range stat like this, if you add the player's velocity to the bullet
as-in the actual distance between spawn and despawn will be larger
in global terms, yes. but that's how it should be
in global terms, yes
like when I am moving at full speed or stopped, this way the bullet gets extra velocity from the player and travels the same range
so I think this is good
depends on your game if this makes sense
this could be easily exploited by just tapping a direction before firing to extend the effective range without the player really moving
if the player isn't really moving then the additional velocity would be low
oh I see what you mean
does the player get to full speed instantly?
pretty close
so I have to choose whether the player can shoot the same range regardless of speed or disallow bullet boosting
maybe just accelerate to full speed over a short time
why wouldn't that work?
it already takes a whole second to accelerate to max speed
ahh okay. then the bullet boosting thing isn't a problem
you can maybe sufficiently nerf it by adding recoil
i can already picture players going backwards at super speed 😂
ik its going to be cool