How to create a particle trail based on mouse touch?

Falcon80Falcon80 Member Posts: 42
edited November -1 in Working with GS (Mac)
Something like the demo here.



I tried to set the position offset of the particle to the device.touch1.x and device.touch1.y but it is not appearing at the right position.

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Have you tried mouse x & y?

    Darren.
  • Falcon80Falcon80 Member Posts: 42
    utopiangames said:
    Have you tried mouse x & y?

    Darren.

    Yup. Doesn't seem to work either.
  • Falcon80Falcon80 Member Posts: 42
    Anyone can help me? I want the trail to appear only when I click on a particular actor. I tried a couple of combinations but nothing seem to work. Thanks in advance.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Falcon80, if you mean you want a trail of particles from an actor that's dragged, put the following in the actor's Rules:

    When touch is pressed

    Constrain Attribute self.Position.X to game.Touches.touch 1.X
    Constrain Attribute self.Position.Y to game.Touches.touch 1.Y

    Then your Particles Behaviour. (In Velocity/Position Direction, put random(0,360); and Spawn Rate, Particle Startup time to 0).

    Hopefully that's what you're after. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Falcon80Falcon80 Member Posts: 42
    Hi gyroscope. Thanks for the input. My actor will be not be dragged. The trail of particles will follow the touch of my finger but that will only appear when the touch is within the area occupied by the actor. For my case, the actor is actually an animal. I want to allow the user to be able to pet the animal or play with it.
  • Falcon80Falcon80 Member Posts: 42
    Just realized the emitter offset is relative to the center of the actor and not the exact position of the particle on the scene.
Sign In or Register to comment.