Jump to content


Photo

Drawing Particles at Multiple Places


  • Please log in to reply
2 replies to this topic

#1 goldage5

goldage5

    GMC Member

  • GMC Member
  • 152 posts

Posted 11 June 2012 - 02:47 AM

Hey guys,

I am trying to draw particles at an object's position. This works perfectly fine, but only if there is one of that object. If there are multiple, it draws the particles at the one that was created first.

This is the code I am using:

if instance_exists(obj_fire)
{part_particles_create(sys,obj_fire.x,obj_fire.y,fire,1)}

BTW, that code is in the step event.

Can you guys tell me what I am doing wrong?
  • 0

#2 Blue-Ghost

Blue-Ghost

    GMC Member

  • New Member
  • 23 posts

Posted 11 June 2012 - 03:12 AM

with(obj_fire)
{part_particles_create(other.sys,x,y,other.fire,1)}
That should work.
Not really doing anything wrong, just misunderstanding it. You are creating the particle at fire.x and fire.y, which are variables held by the fire object. Game maker doesn't know which fire object you mean, so it just assumes the first one. This code repeats your action for each fire object, using their own variables.

Edited by Blue-Ghost, 11 June 2012 - 03:17 AM.

  • 0

#3 goldage5

goldage5

    GMC Member

  • GMC Member
  • 152 posts

Posted 11 June 2012 - 08:53 PM

Ok, thanks a lot.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users