Make bullets follow player?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Make bullets follow player?
Hi, I'm making a shmup game but I'm having an issue where bullets fired from the player don't stay in front of the player as the player moves. They'll cluster up if the player is moving forward and be too spaced out if the player is moving backwards. I've tried adding the velocity of the player to the velocity of the bullet every frame, but this creates another awkward effect where the bullets will seemingly move too fast or too slow depending on the player's movement. I was wondering if there's a proper way to fix this. Thanks.
Re: Make bullets follow player?
The effect you are describing occurs in most commercial shmups, so I wouldn't worry about it if I were you.
But if you really want to worry about it, try adjusting the firing rate, so that you fire slower if moving forward and faster if you are moving backwards. There's probably some math you could use to work out exactly how much to adjust the rate of fire by, but I'd just eyeball it to get something that looks okay.
But if you really want to worry about it, try adjusting the firing rate, so that you fire slower if moving forward and faster if you are moving backwards. There's probably some math you could use to work out exactly how much to adjust the rate of fire by, but I'd just eyeball it to get something that looks okay.
Re: Make bullets follow player?
Raising the speed of the bullets might also help make the effect less noticeable. It's not something you can avoid, it's just a natural consequence of how the world works.
Re: Make bullets follow player?
Maybe change the countdown based on player speed or add the player speed to all bullets?
Re: Make bullets follow player?
Changing the speed and countdown seems to remedy the issue to an extent, but then I still have the problem of the player sort of "outrunning" their own projectiles which looks strange. I can add the player speed to each bullet but then there's some other strange effects, like bullets clearly appearing to move more slowly, or even backwards, if the player moves backwards.
Re: Make bullets follow player?
A method I use is making it so if they have an x below the player increase, x above decrease, y above decrease, y under increase, etc
Who is online
Users browsing this forum: Google [Bot] and 2 guests