Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: GM Collision with multible objects  (Read 2725 times)

0 Members and 1 Guest are viewing this topic.
GM Collision with multible objects
« on: November 02, 2013, 05:06:49 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 5
Hey, everyone.
I'm using an object 'object_wall' and the parent option to check collsion at the moment.
Now that I want to implement different level of cliffs, for example object_wall_lvl1, object_wall_lvl2, etc and liftable objects, it does'nt work fine for me anymore.
In GM, you cant set the parent of a single instance to false - only the object including all instances of it. Meaning when I lift an block I can walk through any other block of the same type.
Better example: When I shoot an arrow at an lvl1 cliff, lvl2 walls should act like an wall for the arrow and lvl2 and below should not.
Does anyone have an idea to solve this in an efficiant way and can help me a bit?
Logged
Re: GM Collision with multible objects
« Reply #1 on: November 02, 2013, 06:30:04 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
hm, that question is not totally clear, but I will try.

For lifting something I suggest you use the instance_nearest function, so it can see that you that only lift the object with that ID.

For the arrow:
The arrow can not see what you intend to hit with it.
You can make it so that a certain type of arrow can pass over a type 1 cliff and gets blocked by a type2 cliff by adding a code like this to the arrow's step event:
if place_meeting(self.x,self.y,object_wall_lvl2( { instance_destroy() }
It does not need a parent option in that case.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.069 seconds with 41 queries.

anything