Possible to set created object instance properties

Discussion and feedback on Construct 2

Post » Sun Oct 13, 2013 5:12 pm

Hi,

It is possible to immediatly set created object instance properties ?

Like i want to create an object and then set some instances properties to that object immediatly after ?

That would be nice to have something like LastCreatedUID or whatever to pick that object in a subevent or something.

Thanks!
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Sun Oct 13, 2013 5:32 pm

You can do that in the same event as the created object :P Just have the instance variables and make sure to put the "Set variables" events AFTER the "Create" event.

-On mouse click
+Create "Sprite" (0,0)
+Set Sprite "HP" to 155
+Set Sprite "Name" to "Bob"

Edit: AS FOR sub-events, I'm pretty sure it automatically selects the object you created in the main event (though I may be wrong).Jase002013-10-13 17:33:51
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Sun Oct 13, 2013 5:40 pm

Alright it work now.. ! Thanks sorry for being a n00b.. haha at first i was pretty sure we could do this otherwise it would have been bothersome!Rushino2013-10-13 17:41:04
B
16
S
5
G
1
Posts: 190
Reputation: 2,489


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests