How do I prevent my input from effecting enemy movement?

Get help using Construct 2

Post » Wed Sep 21, 2016 9:05 pm

All in all, my test level is working pretty well. I followed along with the platformer tutorial here and used my own spritesheets and played with a few additional things.

Here is my problem. I have my enemy moving around by using the 8Direction behavior for input and the Platform behavior to act like a... platformer enemy

When my 'BunnyEnemy' is moving left and I press right to move right, my enemy stops moving as if my input is voiding out it's input while I have the opposite direction pressed.

If I don't touch anything, the enemy walks left and right, detects edges and works as expected. As soon as I start moving in the opposite direction of my enemy, the input gets conflicted. When I release the input, the enemy just picks up and keeps moving as programmed.

It is a minor bug but it is really irritating me and preventing me from wanting to proceed.

Thanks in advance!
B
2
Posts: 3
Reputation: 156

Post » Wed Sep 21, 2016 9:17 pm

check if your enemies have the "default controls" activated, they may be reacting to your keyboard input, set defaults controls to no for everything that you dont want to move with your inputs.
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338

Post » Wed Sep 21, 2016 9:20 pm

Perfect! You solved it for me. It seems so obvious now. I had Platform Default Control set to No but 8direction Control set to Yes.

Thank you so much. I knew I'd love this community.
B
2
Posts: 3
Reputation: 156

Post » Wed Sep 21, 2016 9:21 pm

Now I need to know how to change the jump key from Up Arrow to Z
B
2
Posts: 3
Reputation: 156

Post » Wed Sep 21, 2016 9:27 pm

On z pressed - simulate control "jump" :)

In events use the keyboard object and choose "on key pressed" event and select "z"

Then in the action section choose your object with the platform behaviour and there you'll find the simulate control action and just set it to jump.

But simple stuff like this is easily found on the forum if you search ;)
B
57
S
24
G
14
Posts: 773
Reputation: 13,137

Post » Thu Sep 22, 2016 12:02 am

716green wrote:Now I need to know how to change the jump key from Up Arrow to Z


if you want to remap the entire keys you use for moving your character, set default controls to NO and add the Keyboard plugin to your project, once is added go to your event sheet and you will need to create the event:

keyboard | on key pressed = player| simulate control JUMP

once you had set the "default controls" to no, you will have to entirely remap all your keys.
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests