I am making an enemy. The enemy needs to fire towards the player without pointing at it (The player object). I have the globals but there is only one input for angle. I feel like there’s some super-simple way of fixing this, but I just can’t find it.
I have most of the behaviors and objects set up, I just need to know how to get these:
Into here:
. Please help,
I know this is already been solved, but an easy and simple way i generally go about this is on Once, the bullet extracts the players X and Y, then rotates to the correct angle. Then you could also adjust the speed by changing the velocity value.
I don’t think he stated it was a bullet ■■■■ game, so I suggested this. Plus I don’t think it would lag the game at all since it only detects the players location only once on spawn.
This could also be achieved with a proximity and a point at to change the angle. I’ve used these methods many of times for simple gunfire of both enemies and players and haven’t had issues, but then again, I haven’t pushed the limits.
I think the way Kasmir mentioned is just fine. It takes minimal cade and works as I need it to.
Never mind…It just bugged. The enemy only fires towards the player when they’re to the enemy’s right.
I tried what @JR01 mentioned but the enemy shoots to high now. The player messages the globals to the enemy, that puts them directly into the angle input.
The enemy bullet is the tiny red dot.