Enemy spawn with hitbox?

Get help using Construct 2

Post » Tue Dec 03, 2013 7:36 am

I was thinking about creating random enemy spawns in the game (which is a platformer type game).

However, I keep running into problems.

Now, the enemy is fine if I manually place him. He is pinned to his hitbox at the start, and all is well.

However, when I have the game spawn him at a spawn point, he is no longer pinned to his hitbox.

I moved the enemy outside the layout and set him to destroy outside layout so he wouldn't interfere.

I put the enemy and the hitbox in a container, and they both do spawn. They just aren't pinned. The enemy is stuck in place while the hitbox chases me around.

I created the random enemy spawn by an event with system > create family (enemies) at a specific location.

I don't know how to get the enemy pinned to the hitbox after he spawns. I already have code that was supposed to pin them (on start of layout, pin enemy to hitbox).
B
72
S
29
G
35
Posts: 340
Reputation: 22,721

Post » Tue Dec 03, 2013 8:19 am

Could you post your .capx? Maybe I could find a solution :)
Member of PLUS(S). Check out our games at: http://pluss.newgrounds.com/
B
8
S
1
G
1
Posts: 23
Reputation: 838

Post » Tue Dec 03, 2013 8:29 am

Create hitbox (if the enemy is in a container the enemy will be created too)

Enemy on created - pin to hitbox
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 Dec 03, 2013 4:31 pm

[QUOTE=LittleStain] Create hitbox (if the enemy is in a container the enemy will be created too)

Enemy on created - pin to hitbox[/QUOTE]

That's what I was looking for! Thanks.

I had to also add an event to set the position of the enemy to the hitbox, and I had to adjust the origin point of the hitbox since it was off.

It seems to work now. :)
B
72
S
29
G
35
Posts: 340
Reputation: 22,721


Return to How do I....?

Who is online

Users browsing this forum: Sparkz and 1 guest