when i fire a weapon like plasmagun, all projectiles exit from the weapon if i do not move
but if i strafe right whilw shooting, i can now see projectiles exiting from thin air on my left
is there a way to make all projectiles being aligned, even while i am moving and shooting ?
problems when firing projectiles and moving
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 21
- Joined: Sun Apr 30, 2023 8:44 pm
Re: problems when firing projectiles and moving
I guess this is the normal behaviour. There is no like inertia for every projectile created by a moving actor.
You could maybe add inertia if you get the vector speed of the actor firing the projectile and add it to the vector speed of the projectile. But I wonder how weird it could be, because it could become impossible to aim at a target if you are moving.
You could maybe add inertia if you get the vector speed of the actor firing the projectile and add it to the vector speed of the projectile. But I wonder how weird it could be, because it could become impossible to aim at a target if you are moving.
Re: problems when firing projectiles and moving
Projectiles are spawned at the player's center before they start moving, which is why they appear to spawn from nothing when strafing.
To fix this you could use the function from this topic and add a little bit of X offset to make the projectiles spawn in front of the player rather than at the center.
If you don't want to do that, you can always add the player's velocity to the projectile as snakebyte mentioned:
However this will make aiming problematic.
To fix this you could use the function from this topic and add a little bit of X offset to make the projectiles spawn in front of the player rather than at the center.
If you don't want to do that, you can always add the player's velocity to the projectile as snakebyte mentioned:
Code: Select all
PLSG A 3{
let proj = A_FireProjectile("PlasmaBall");
proj.vel += self.vel;
}