How do I fix my pin problem?

Get help using Construct 2

Post » Mon Jun 20, 2016 3:56 am

Hi,

So, the pin behaviour is not being pinned... just look for yourself:

https://dl.dropboxusercontent.com/u/200 ... oblem.capx

I create a new plane with the "spawnPlanes" function (line 14), but the arows are not following the plane, even though they are pinned :(

Thanks for your help guys.
B
25
S
8
Posts: 81
Reputation: 1,691

Post » Mon Jun 20, 2016 5:55 am

I cant download it.. I have a low connection.
But you can put system-Every tick l spawnplanes set position to sprite.x and .y or
`` l spawn planes set position to object sprite at image point ..
B
13
S
5
G
4
Posts: 119
Reputation: 3,353

Post » Mon Jun 20, 2016 1:19 pm

Uh, nope. Not pinned.

The family does not exist in the container (can't), so it is not referenced. As a result all arrows re-pin.
The green circle does not exist yet, created objects are actual created at the end of the tick, as result they pin to that one allready existing green circle, since the circle is not referenced.

Use the 'on creation' for the green circle, and pin the arrows. They are picked with the right green circle because of the container.

https://drive.google.com/open?id=0B1SSu ... FRxUkt4a3c
B
33
S
18
G
27
Posts: 2,447
Reputation: 20,358

Post » Mon Jun 20, 2016 1:28 pm

fathijack1999 wrote:I cant download it.. I have a low connection.
But you can put system-Every tick l spawnplanes set position to sprite.x and .y or
`` l spawn planes set position to object sprite at image point ..


It's not working... :|
B
25
S
8
Posts: 81
Reputation: 1,691

Post » Mon Jun 20, 2016 1:59 pm

Don't need pin behavior just knock it out code style

System--every tick---select object to be pinned--set position to another object

BAM!! you coded it without pin behavior!!
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Mon Jun 20, 2016 9:24 pm

yeah but using every tick is gonna take a hit on the performance. I know one trick i did was on start set position to the object and then pin it. Also help to keep your sprite origin in check as well since that where the pin is using it.
B
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » Mon Jun 20, 2016 9:50 pm

Actually you don't need to repeat this
System Every tick

You could just leave an empty condition and then actions: objectA Set position to ObjectB (ImagePoint x)
I 'm doing it this way in my project.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Fri Jun 23, 2017 7:40 am

@FraktalZero

That solution is a life saver!
B
9
S
3
G
1
Posts: 43
Reputation: 1,288


Return to How do I....?

Who is online

Users browsing this forum: David181 and 14 guests