Family - spawn another object

Just started using Construct 2? Post your questions here

Post » Thu Apr 02, 2015 12:18 pm

I have a family that contains several sprites, I want to duplicate the sprite that is touched with the touch. I used the method spawns another object, but this creates a sprite in the family, but random and not really what I have touched.
Could you tell me the correct way, thanks.
B
4
Posts: 7
Reputation: 226

Post » Fri Apr 03, 2015 9:59 am

There are many way's to do this.

You can make it without a family, on object touched - create the same object.

Also you can add instance variable to the family, and set the sprites to different numbers.
On family touched
---sub event - family instance = 1 ------ create sprite holds instance 1.
Image
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,145

Post » Sat Apr 04, 2015 5:27 am

This is ok, but I want to manage it with families or anything else because I want to say that when one of the sprites, which belong to a group, is touched, then I have to create a duplicate of that sprite. I want to manage it massively and not making a control for each sprite, ok? You can encode in this way? How?
Thanks for letting me respond
B
4
Posts: 7
Reputation: 226

Post » Sat Apr 04, 2015 8:07 pm

To my knowledge, there is no native "Create Object" action that lets you spawn using a name, which is what you'd need to implement it the way you want.

However, I did come across this plugin by rexrainbow, that might help you: plugin-nickname-behavior-nickname_t74522

I've never used it, so I don't know, but essentially if you can get the nickname of the Family instance, and then Create object by that Nickname, you'd have what you need.
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Sun Apr 05, 2015 8:06 am

Excellent Dalal, you've been a great help. Forgive my English, I'm Italian. I now I try this plugin and will announce the result .... thanks you're a friend
B
4
Posts: 7
Reputation: 226


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests