Jump to content


Photo

Two Objects Colliding


  • Please log in to reply
9 replies to this topic

#1 martinalexander

martinalexander

    GMC Member

  • New Member
  • 167 posts

Posted 16 November 2008 - 03:38 PM

If say... Object1 collides with another Object1, how do I create a new object (for example Object2) at that collision positíon? Just typing coords Object1.x & Object1.y always creates the instance at another "pre-defined" Object1 :( !
  • 0

#2 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16793 posts
  • Version:GM:Studio

Posted 16 November 2008 - 04:36 PM

Are the two objects that collide the same? If they are it´s a bit more complex as they will both have the same collision event... And do you want object2 to be created at the actual point of collision?
  • 0

#3 martinalexander

martinalexander

    GMC Member

  • New Member
  • 167 posts

Posted 16 November 2008 - 06:02 PM

Are the two objects that collide the same? If they are it´s a bit more complex as they will both have the same collision event... And do you want object2 to be created at the actual point of collision?


Yes, it's 2 of the same object that is colliding, and I want the third object to be created at the collision position!
  • 0

#4 Halowar77

Halowar77

    GFX Programmer

  • New Member
  • 300 posts
  • Version:GM8

Posted 16 November 2008 - 06:25 PM

Here is an example of how to figure out where to create the object. It is very basic but it works.

Collision Creation.gm6

Edited by Halowar77, 16 November 2008 - 06:58 PM.

  • 0

#5 martinalexander

martinalexander

    GMC Member

  • New Member
  • 167 posts

Posted 16 November 2008 - 06:39 PM

Here is an example of how to figure out where to create the object. It is very basic but it works.

Collision Creation.gm6


Well, seems to be too advanced for such a simple task :( !
  • 0

#6 martinalexander

martinalexander

    GMC Member

  • New Member
  • 167 posts

Posted 16 November 2008 - 06:44 PM

Creature "Carnivore" collides with creature "Carnivore", egg is created at same position... That's the exact thing I want.
  • 0

#7 Halowar77

Halowar77

    GFX Programmer

  • New Member
  • 300 posts
  • Version:GM8

Posted 16 November 2008 - 06:53 PM

So do you want it to be created at the origin of the Carnivore, because by what you were saying you wanted it at the position of the collision.

Here is a commented version. With a few minor edits.

Collision Creation.gm6

Edited by Halowar77, 16 November 2008 - 06:59 PM.

  • 0

#8 martinalexander

martinalexander

    GMC Member

  • New Member
  • 167 posts

Posted 16 November 2008 - 06:59 PM

So do you want it to be created at the origin of the Carnivore, because by what you were saying you wanted it at the position of the collision.


Yes, I want it at the position of the collision... When two Carnivore collides, I want them to leave an egg at the position they are colliding at!
  • 0

#9 Halowar77

Halowar77

    GFX Programmer

  • New Member
  • 300 posts
  • Version:GM8

Posted 16 November 2008 - 07:02 PM

Check my example. That is what it does.
  • 0

#10 martinalexander

martinalexander

    GMC Member

  • New Member
  • 167 posts

Posted 16 November 2008 - 07:05 PM

So do you want it to be created at the origin of the Carnivore, because by what you were saying you wanted it at the position of the collision.


Yes, I want it at the position of the collision... When two Carnivore collides, I want them to leave an egg at the position they are colliding at!


Omg... All I needed was to set the create instance position relatively to 0,0, and NOT Object1.x, Object1.y :( !
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users