Action based on UID

Get help using Construct 2

Post » Sat Feb 23, 2013 1:25 am

I have a ship with 4 turret instances on it, set to 4 ImagePoints. I'd like to keep them on those points when the ship moves.

The action I tried was:

System Every Tick - (TurretObject) Set position to (ship.ImagePointX(Turret.UID), ship.ImagePointY(Turret.UID))

However, it sets them all to ImagePoint0.


Additional question - How should I be using groups? I read about how objects can be grouped for picking purposes. It doesn't apply for my current project because I only ever have one ship at the moment, but if I had multiple ships I might want to use this logic. However, when I made a group with the ship and turret and added my 4 turret instances to the ship, it made 4 more ships too! Would I need a separate turret objects for each turret rather than instances of the same turret object?

Mistakes were made.
B
37
S
17
G
67
Posts: 1,041
Reputation: 38,211

Post » Sat Feb 23, 2013 2:25 am

I would try the pin behavior which lets you select which image point you want. No need to do an every tick, as it takes care of that for you.BluePhaze2013-02-23 02:25:43
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Sat Feb 23, 2013 2:30 am

Thanks, pin was what I was looking for.

Forgot to look in the behaviors.

For future reference in case someone searches into this thread

Pin Behaviour
https://www.scirra.com/manual/99/pin

Pin to Image Point -
http://www.scirra.com/forum/pin-to-image-point_topic60036.html


Mistakes were made.
B
37
S
17
G
67
Posts: 1,041
Reputation: 38,211


Return to How do I....?

Who is online

Users browsing this forum: Calfuso, ETgirl79, totoe, Yahoo [Bot] and 22 guests