Making an object not solid at runtime?

For questions about using Classic.

Post » Tue Jan 05, 2010 10:25 am

I can't seem to find a way for a solid object to become non solid using an event. Is there a way for objects having a "solid" attribute to become "not solid" if a requirement is met? Like a variable or something.

Like if FloorA is overlapped, ObjectA becomes not solid. Something like that. Is that possible?
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Tue Jan 05, 2010 2:37 pm

Sorry you cant. The work around is to destroy the solid object and create an identical one that does not have the attribute.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Jan 05, 2010 3:37 pm

I don't know if it helps but, you can kind of toggle your object's solid behavior by Setting collision mode to None
[code:22dhig9v]+ ObjectX: ObjectX overlaps FloorA
-> ObjectA: Set collision mode to None[/code:22dhig9v]
B
3
G
3
Posts: 15
Reputation: 905

Post » Tue Jan 05, 2010 4:03 pm

Yeah, it just depends on what behavior your using.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Wed Jan 06, 2010 5:52 am

Hmm, well I'm using the RTS behavior. I need this because I have a part in my game where objects will spawn or get teleported on 1 square floor tiled background object and from that, they would move around and scatter and once they're not stepping on that square floor anymore, the become solid.
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Wed Jan 06, 2010 5:57 am

You could do some trickery where you have an invisible object like a Tiled Background or whatever that you use for collision purposes on top of your Solid objects. Set your solid objects collision mode to None, then use the invisible object to detect whether or not the space is occupied. When it is no longer occupied you can change the solid objects back to Per Pixel or Bounding Box or whatever.

I know it's kind of cluttery having extra objects like that but without being able to toggle the attribute it's probably your best bet.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Jan 06, 2010 6:33 am

I see. I'll try that thanks.
B
10
S
5
G
8
Posts: 203
Reputation: 4,395


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests