[SOLVED] How do I use the keyboard only for one instance

Get help using Construct 2

Post » Tue Sep 08, 2015 9:00 am

Hello guys,
Lately I have been trying to make a bgame using gamepads, but I would love to keep the keyboard available for "player1".
The thing is, I spawn my 4 players using the same object but spawning a difference instance, with a variable instance "ID" growing (0-1-2-3).
Then when I use the keyboard, I specify, "pick the player with player.id=0" and simulate the 8 direction. so that's basicly :

keyboard -> when left arrow is down
player -> pick instance with player.id=0 --> simulate 8 direction pressing left

But when I do that, I launch the game, and all my players instance are moving with the keyboard, at the exact same time.
Would you happen to know what could cause this ? I can't seem to find the answer... verifyed the id etc, all seems correct !

Thanks a lot,
Mael
Last edited by Khelben on Tue Sep 08, 2015 12:06 pm, edited 1 time in total.
B
7
Posts: 29
Reputation: 331

Post » Tue Sep 08, 2015 10:52 am

8Direction behaviour is enabled for all your instances, that is why you move all objects at once. You should set it disabled by default and enable it only for the instance you want to move. You don't have to pick the instance by ID then.
ImageImage
B
27
S
16
G
68
Posts: 935
Reputation: 38,579

Post » Tue Sep 08, 2015 11:07 am

Hey Backend, thanks for the answer but I need the behavior to be active for all instance, since they move thanks to the gamepads. Or do I have to enable them each time ?
B
7
Posts: 29
Reputation: 331

Post » Tue Sep 08, 2015 11:38 am

I am not really sure what you want to achieve but in order to move only one instance you need to:

- enable this behaviour only for one instance

OR

- set "Default controls" (8Direction property) to "No", and then simulate controls by picking the instance as you shown in your first post here
Last edited by BackendFreak on Tue Sep 08, 2015 3:52 pm, edited 1 time in total.
ImageImage
B
27
S
16
G
68
Posts: 935
Reputation: 38,579

Post » Tue Sep 08, 2015 12:05 pm

Hey backend,
Thanks a lot, this solved my issue (- set "Default controls" (8Direction property) to "No").
All the instance was using the arrow, when I only wanted one.
B
7
Posts: 29
Reputation: 331


Return to How do I....?

Who is online

Users browsing this forum: MoscowModder and 11 guests