How do I manage the instances of the same object?

Get help using Construct 2

Post » Tue Oct 07, 2014 2:16 pm

Hi
I am making a racing game and I need to set the wheel speed to the car's speed but for optimizing I used all wheels as one object but I don't know how to set different rotation speed for different instances.
Thank you
B
14
S
4
G
2
Posts: 91
Reputation: 2,430

Post » Tue Oct 07, 2014 4:53 pm

Add an instance variable to the wheels (a text will do just fine) and name each wheel in a meaningful way (e.g. Front, Back).

Use the compare instance variable condition to filter out each wheel and apply the desired actions.

Your code should look like this:

Every tick
---->Wheel | Variable = "Front" ====> Apply actions
---->Wheel | Variable = "Back" =====> Apply different actions
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Tue Oct 07, 2014 6:16 pm

I got that thank you so much!
B
14
S
4
G
2
Posts: 91
Reputation: 2,430

Post » Tue Oct 07, 2014 10:12 pm

You are welcome :)
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests