Attack box to move with player

Get help using Construct 2

Post » Sun Dec 30, 2012 9:29 am

Whenever I have the "Player" attack, the "attack boxes" are only in the area I have them "spawn" at which is either "image point 0 or 1". How can I get the "attack boxes" to stay with my character when they "spawn" until I have them "destroyed"?

I've tried using the "set to" which I learned in the platform tutorial and I've tried some things with the "pin" behavior, but I got nothing from it. If anyone can help it would be very helpful for the progress of my learning.
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Sun Dec 30, 2012 9:49 am

You can use Pin at start of layout or on creation, but you first have to manually set the position and angle to match the player object (Pin is relative to its starting position). The alternative is to update the position of the player character to match that of the player box every tick.

Just FYI, what you want is for the user to control the boxes, not the animated character, then update the character to stay with the boxes. All controls should be assigned to the box for the most accurate collisions and controls, and animation changes should be assigned to the character.

capx
B
56
S
15
G
10
Posts: 910
Reputation: 11,952

Post » Sun Dec 30, 2012 10:01 pm

It took me about 15 minutes to get what you were saying, but after messing with it I finally got it. Thanks a lot Geometrix!
B
23
S
6
G
3
Posts: 122
Reputation: 2,922


Return to How do I....?

Who is online

Users browsing this forum: gregorysforster, jeffige, Matthew de, onzephyr and 1 guest