Keep an object attached to another

Get help using Construct 2

Post » Fri May 09, 2014 4:23 am

I know about the pin behavior, but I'd like to keep objects (like guns or shields) attached to a character's hand which moves as he animates. Oddly enough, simply using "Set position to object" every tick will make the gun/shield lag behind the character. Why is this, and how can I keep it attached?
Last edited by MoscowModder on Fri May 09, 2014 5:26 am, edited 1 time in total.
B
8
S
1
Posts: 97
Reputation: 826

Post » Fri May 09, 2014 4:36 am

When you set position to object, does every frame have the same image point on your hand? Double check that for if you every tick set the gun to image point 1 see if image point 1 is on every hand for all your animations.

-edit-

Just reread your post, if you are using every frame try changing it to every tick
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
2
Posts: 113
Reputation: 1,245

Post » Fri May 09, 2014 5:26 am

It is every tick. Slight typo in my first post.
B
8
S
1
Posts: 97
Reputation: 826

Post » Tue May 13, 2014 11:19 pm

I hate to do this, but... bump?

I still can't for the life of me figure out why setting an object's position to another every tick would make it lag behind the other.
B
8
S
1
Posts: 97
Reputation: 826

Post » Tue May 13, 2014 11:32 pm

I had this trouble in MMF.. I haven't attempted anything like this in construct.. However, if there's a pin-to type function, you could use that and alter the actionspots and hotspots in your animation... Again, I have no actual experience, just trying to give you an idea on how to proceed.
B
4
S
1
Posts: 12
Reputation: 817

Post » Wed May 14, 2014 3:43 am

Pin-to-type? Would this somehow be different from the existing Pin?
B
8
S
1
Posts: 97
Reputation: 826

Post » Wed May 14, 2014 5:52 am

I'm having this problem for my shadow of colossus based game too. The sword is always lag behind the character when the character move with fast speed/ falling/ jumping.
It will be great if someone can figure out how to deal with this problem.
B
6
S
2
Posts: 9
Reputation: 460

Post » Sun May 18, 2014 5:50 pm

System Every Tick (your sword sprite) set position to (your Player Sprite Image Point 1) You need to create a new point on your player sprite . I did that for a helper and it's constantly attached to my character even when moving quite fast so that should probably work. Cheers
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Sun May 18, 2014 6:33 pm

Also the events are read from top to bottom, so make sure that first the player is placed, then the gun if possible
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Sun May 18, 2014 8:59 pm

@FraktalZero: That's what I'm doing.

@Aphrodite: The player is placed by pinning him to a separate object that handles his platforming, so his position is not controlled by my 'code'.
B
8
S
1
Posts: 97
Reputation: 826

Next

Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 7 guests