How do I trigger animation when obj in touch

Get help using Construct 2

Post » Sun Sep 07, 2014 5:19 am

Hi,

I have uploaded the .capx here: http://www.filetolink.com/f7c18d80f8
Since it was heavier than 2mb

When I touch the blue squares the hero faces the right direction but doesn't move.

I need my hero to move like when the keyboard keys (up, down, left, right) are pressed down.
B
5
S
1
Posts: 38
Reputation: 482

Post » Sun Sep 07, 2014 5:30 am

Haven't downloaded the file as I'll only download from Dropbox, but you should just require a collision detection. If they won't move through an object check if the object is solid and whether collision is on, as either the solid state or collisions need to be turned off. If you wanted to trigger an animation itself when touching the block, that requires checking a collision event when the player touches the blue square, and then to start an animation of a sprite you've made and named.
Founder of Jadelight Studio, Developer of Libertas Aedifex, regular C2 Help contributor and fan of ambient music and Star Wars.
B
12
S
4
Posts: 255
Reputation: 2,008

Post » Sun Sep 07, 2014 5:32 am

I'll upload to dropbox. @inquiesco
B
5
S
1
Posts: 38
Reputation: 482

Post » Sun Sep 07, 2014 5:35 am

B
5
S
1
Posts: 38
Reputation: 482

Post » Sun Sep 07, 2014 5:37 am

@inquiesco

It is not about collisions. It is abouth character/sprite movement.

It works when I use the keyboard. But not when I use the mouse.

By clicking and holding down the click from the mouse. The hero should move. I already tested this on my iPad. And didn't work either.
B
5
S
1
Posts: 38
Reputation: 482

Post » Sun Sep 07, 2014 5:44 am

@jminfantem Not sure how you set-up your project, but it doesn't support Mouse input objects, only Gamepad input. If you make a new standard SD/HD project and shift all your assets across (unless there's an easier way someone else might know?) , then you can add the Mouse input object and create click events for the controlUp, Right, Down and Left objects.

Also, please try to make one post instead of three when they can quite easily be one, :).
Founder of Jadelight Studio, Developer of Libertas Aedifex, regular C2 Help contributor and fan of ambient music and Star Wars.
B
12
S
4
Posts: 255
Reputation: 2,008

Post » Sun Sep 07, 2014 6:13 am

You need to add 8Direction:'Simulate control' when you use the touch-controls. IE: event 14, add: Hero->Simulate 8Direction pressing Right.
ImageImageImage
B
71
S
21
G
233
Posts: 3,696
Reputation: 130,368

Post » Sun Sep 07, 2014 6:32 am

Thanks a lot! @blackhornet It worked like magic.
B
5
S
1
Posts: 38
Reputation: 482


Return to How do I....?

Who is online

Users browsing this forum: David181 and 28 guests