How Do I Get 'System Every Tick' To Work

Get help using Construct 2

Post » Tue Nov 19, 2013 9:31 pm

Hello,

I am working on a platformer and I can't get Every Tick to work.

My problem:

When the player collides with a treasure i want the system to spawn a w crossbow at the player's image point. During test I see that the system spawns the crossbow, but crossbow doesn't stick with the player. So how can i make it stick with the player as they move.

My Event Sheet:

->Treasue | ON collision with player
   (Sub-Event) System | Every Tick | crossbowsprite | Set to player (image point 1)       
B
6
Posts: 9
Reputation: 291

Post » Tue Nov 19, 2013 9:38 pm

Pin behavior or
add player.x to your equation

If your image point is in the middle of the sprite and the sprite is 20x20 pixels big, imagepointx(1) will give back 10, no matter where the sprite is.mindfaQ2013-11-19 21:38:39
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Tue Nov 19, 2013 9:42 pm

In your event, Every Tick is only triggered when the player collides with the chest, so it's not actually running every tick as it's part of a condition.

Like mindfaQ said, you can just use the pin behavior to then pin the crossbow to the player. If you really want to use an every tick action, then create an inactive group with the Ever Tick event, and activate that group after you get the crossbow. Just remember to deactivate the group when you don't need that Every Tick running anymore.
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Tue Nov 19, 2013 9:51 pm

Thanks for the rapid response, my only concern is i don't know what the "PIN" behavior is. If someone could link that for me that would be great! Thanks everyone.
B
6
Posts: 9
Reputation: 291

Post » Tue Nov 19, 2013 9:57 pm

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 19, 2013 10:02 pm

Thanks everyone! This has solved my problem
B
6
Posts: 9
Reputation: 291

Post » Tue Nov 19, 2013 10:08 pm

@HeroicSoftware I would recommend going through the tutorials as they would have covered this in the beginning tutorials on platformers. A lot of good stuff that will save you time and effort if you just do the beginning tutorials.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583


Return to How do I....?

Who is online

Users browsing this forum: nahima and 7 guests