Pin behavior or Set position to another object.

Discussion and feedback on Construct 2

Post » Thu Jan 30, 2014 4:09 pm

Hi everyone.

I'm currently making a platformer game, with a player composed of multiple sprites. (I use this to split the player in half, this way i can shoot / slash with the torso / arms, and continue walking or jumping legs animations), the elements are positioned over an invisible sprite wich has the platformer behavior.

Here is my question, what do you think is best suited for this, the pin behavior or the Set position to another object every ticks ?
It feels the same for me and the two work, but i'm wondering if one is best suited and better for performances (CPU usage frame rate).

Actually i dont really get the difference between the two.

Thanks.
... "Je suis CHARLIE" ...
B
30
S
6
G
2
Posts: 43
Reputation: 2,075

Post » Thu Jan 30, 2014 5:04 pm

i had the same question a while back and after some snooping around i think that the pin behavior is just a
every tick+Set position to another object+automated coordinates(x,y)because you visually "pin" it to the other object.

Roccinio2014-01-30 17:18:46
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Thu Jan 30, 2014 5:30 pm

@Roccinio i had the same reflection.
I started at first by using the Set position to object, and when all was working just fine i remembered the Pin behavior, i tried it again and ended with the same result, pin with angle/position option.

On a small project i guess we can use one or another, but for a bigger project i'm wondering which is best, performance wise.
... "Je suis CHARLIE" ...
B
30
S
6
G
2
Posts: 43
Reputation: 2,075

Post » Thu Jan 30, 2014 7:38 pm

@Ashley
i am almost certain that they are 100% the same performance wise.but i guess only our software guru can answer this!
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Thu Jan 30, 2014 8:26 pm

This has come up a couple of times and the answer is that they are identical in terms of performance.
B
57
S
15
G
11
Posts: 912
Reputation: 12,626

Post » Thu Jan 30, 2014 10:11 pm

Thanks guys for the answers ! I searched in the forum and wasn't sure. Would be good if a post was made with the various concerns about Behaviors and actions performance comparision. I saw a post similar to the mine about Bullet and movement ;).
... "Je suis CHARLIE" ...
B
30
S
6
G
2
Posts: 43
Reputation: 2,075

Post » Thu Jan 30, 2014 10:23 pm

You're going to get the same results either way. Just use the one that you're most comfortable with.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Thu Jan 30, 2014 10:26 pm

I'd pin it. Just because I like the sound of it.
B
35
S
9
G
3
Posts: 493
Reputation: 4,092

Post » Mon Mar 07, 2016 2:08 am

Just fell on this thread and thought I'd add my input.
As of this moment, the Pin behavior is more reliable when you need to do accurate tracking. For example, I needed an object's location and rotation to update in relation to the mouse cursor, without a delay. It did a really great job compared to setting the position and angle every tick.
I have not notice any difference in performance.
B
21
S
5
Posts: 44
Reputation: 1,644


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests