How do I spawn an object with behaviours?

Get help using Construct 2

Post » Fri Mar 06, 2015 1:55 pm

Hey, I'm trying to spawn an object and it have gravity and be solid like the rest, but for some reason when it's spawned it has absolutely no behaviours. From the events all it does is just go forward with no gravity through the whole level. (I have it set to always move forward, and since it has no gravity it flies away.) It might be a setting since I suck and missed it, or maybe I'm meant to do something in events so it works, I'm not sure.

The title might make it seem like I'm spawning an object with new behaviours - that is not the case. I want the object to use what I've already set it to use, but it never does. They're both the exact same object, the only problem is the spawned one isn't the same like it should be.

Here's a video of the issue. Don't hate me for remaking this game, also. It's for a good cause. (Of pissing off my friends.)

Edit: I'm not allowed URL links, so a broken one it is:

http*://youtu.*be/hN1cHBLj-AU
B
3
Posts: 6
Reputation: 187

Post » Fri Mar 06, 2015 2:39 pm

Can you post a copy of your capx? It would be easier for someone here to help if we could see your events.
B
38
S
12
G
11
Posts: 329
Reputation: 7,708

Post » Fri Mar 06, 2015 3:06 pm

@Sauxez
Take a look at this article in the Construct 2 wiki which talks about default instances:
https://construct2.wikispaces.com/Default+Instances

I have a feeling it's related. Basically, when you create something at run-time, it sets the default properties of the new instance to the "prototype instance". If that prototype instance has gravity set to 0, then so will any new instances at creation.
B
31
S
7
G
8
Posts: 232
Reputation: 6,214

Post » Fri Mar 06, 2015 5:55 pm

cacotigon wrote:@Sauxez
Take a look at this article in the Construct 2 wiki which talks about default instances:I have a feeling it's related. Basically, when you create something at run-time, it sets the default properties of the new instance to the "prototype instance". If that prototype instance has gravity set to 0, then so will any new instances at creation.


The legend

Thanks man, if only I had asked earlier about a different project.. would of saved so much confusion. All I had to do was reload everything. You're right, too - I changed some stuff around later on in the same session. You have the Construct guru feelings.

Edit: Alright that worked the first time and now it never works. Could you explain to me in English what that link you sent is saying? There's an XML file on the first layout and layer is all I really understood, I haven't a clue on how you're meant to access or change it.

Another edit: I fixed it for good now, I just remade the entire mushroom and it's events, now it works fine.
B
3
Posts: 6
Reputation: 187


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests