So, the first problem I have some issues in making my “EnemyHand” rotate or flip the correct way. Below is a screenshot and a video to demonstrate what happen:
As you guys can see in the video, enemies that are on the right of the player have have their hands flipped the wrong way, combined with the rotation toward the player.
For the second problem, I want to spawn the enemy from multiple “Enemy spawner” objects while have them randomly picked, but I couldn’t get it to work as it create multiple enemies every time the “Spawner” timer resets, which you guys can see in the video as well. Here is the screenshot of my events for the enemy spawning:
Since the guns are rotating, I think the guns need to be flipped vertically not horizontally.
So, here’s the screenshot of my event when I apply the change:
It kinda worked, but, a new problem present itself:
As you can see, the enemy on the left has it’s hand flipped the wrong way.
When it get close to the player, it’s hand is in the correct position.
When the enemy is too far away, the angle is set to zero regardless of the side they’re on. But then it’s flipped based on the side the enemy is on. That works properly when the gun is rotated but not when it’s at 0°.
It needs to flip the gun differently based on how close the enemy is to the player or it’s rotation.
Fixed it, and it worked perfectly. Though, can you still help me with the second problem, the spawner random pick problem?
What’s wrong with the spawner? It appears to be picking a random point and spawning.
OK, so, I’m sorry for not* specifying something. You see, my project has two game mode, one with zombie and one with “enemy” that fires bullet. The thing is, the way the zombie spawns in the first game mode doesn’t seem to be randomized. Here is the video for showing you:
I’m not so sure of myself either. I think the zombie were spawned simultaneously from some spawners so it seems too quick.
Here are some screenshot of my project:
The bottom events for spawning the zombies.
The configuration of my Spawner object behavior.
Edit1: I forgot the word “not”.
Edit2: The first screenshot was not properly uploaded.
Oh well… I had a very similar problem, with the corresponding sprite flips in the enemy display. It turned out that my map was exactly in the middle of the coordinate cross and problems arose when it “slid” into the negative area. So I simply moved everything (!) into a quadrant so that all positions are always in the positive area. That made a lot of things easier. However, I don’t know 100% whether this could help you here - but since I know… that any input can help…
I think the problem is you’re using a timer on each spawner object. The timers all run at the same time. They’re all expiring at the same time. So, when one gets randomly picked its timer is likely greater than 3 seconds. If you want to spawn 1 every 3 seconds from any of them then you could use a scene timer. Use the elapsed time > 3 first and then the pick random object. There’s no need to pick an object unless the timer has elapsed. But if you’re using the spawn behavior, there’s no need for a timer.
Are you using the spawner? You have the behavior but it’s using the add object and not the spawners spawn objects periodically action. If you used that then you wouldn’t need a timer because it has its own.
I’m sorry to tell you that it’s fine now, because I think the spawners doesn’t make the game hard at all. That’s why I ask you about the spawner problem. But, before ending this topic, I want to ask you something else. Here, let me show you:
The thing is, in the first screenshot, 10 points is added when the zombie is deleted. On the other hand, the second screenshot shows that the instance an “Enemy” is dead, 10 points will be added in the sub-event. If I did the same thing to the first screenshot, the game will continue to add 10 points until the zombie is deleted.
I’m not sure what the question is.
Edit: you could simplify either one by using an opacity tween set to destroy abject when done.
You might need a trigger once or set and check a boolean with is dead or check that the animation isn’t the dead anim.
if you use the tween method then you could use if dead and [inverted] tween exists.
I use the tween method and it worked great. Here are some screenshot:
So far, I haven’t found any issues regarding any tampering with the variables (or so I thought, I’m not sure of myself either.) But again, thank you very much Keith_1377.