Hello
So, i have been trying to make an enemy that patrolls by changing directions when it colides with an object. It can bounce from the right wall, but it cant on the left one. I dont have any idea of why this is happening, so thats why i seek help.
As above its better to link movement to a variable. Above there’s a boolean - which you can toggle between false and true. I like to use a number so i can have 0 as stop and 3 for jump left 4 jump right etc.
So, your events were working wonderfully, untill i started coding the rest of the features for the enemy. now, it doesnt change directions when it colides with the right wall, but it does with the left one.
BTW
When you right click on event you have option to toggle disable
When you do it event will be strike text
Which will mean this event does not work
And this way you can test which event is causing something bad
Also when you rightclick event there will hotkey next to toggle disable
I changed mine to D r was it by default D but if not this will tell you which key to press to do it without right clicking event each time
It makes sense if you change something else
I was sitting today like 6h on a bug
To find out i am so stupid checking every single event to find out i simply toggled animation loop in player animations
SIX HOURS
Anyway are rocks wall or also floor?
Cause my method is for topdown for object to collide only on end of route
Where for platofrmer game where wall are both same object so your object you want to patrol would constantly touch them
You would need to use point inside object condition
Don’t worry, rocks is only a wall, not the floor, so that cant be the problem. Also, i have discovered that the events work perfectly fine if i make the enemy bigger.
So i Guess i Will just make It bigger and call it a day.
So, looks like that was the problem. I have fixed the sprites, and now it works, but this causes a problem with the death animation, causing it to be shown inside the ground , and moved to the Right. If you know how to fix that, please tell me.
I told you you should cut empty space from your objects?
Even better
Actually
1 - instead of spamming wait action you could simply tween object opacity
2 - you could have separate object which would have this exact animation which WOULD NOT have so much empty space on image
And just create it when bones die and delete bones itself
Finally, after 9 days, i have made the enemy prefectly functional.
Now, it bounces from the walls without a problem, it has contact damage, and it dies with a cool little animation.