I usually constrain another actor to the main one, in the layer below and put the particles in there.
e.g.
Player ship = main actor.
Make two variables (integer ones will do) - call them playerX and playerY
In your main actor use two constrain behaviours.
1. Behaviour: Constrain variable playerX to self.positionX
2. Behaviour: Constrain variable playerY to self.positionY
In your second actor (let's call it 'particle spawner') use another two constrain behaviours:
1. Behaviour: Constrain self.positionX to variable playerX
2. Behaviour: Constrain self.positionY to variable playerY
3. Behaviour: Put in your particle code here
4. Behaviour: Change self.alpha to 0
Now your particle spawner will follow your player around.
Put the main actor and particle spawner actor into your scene. In the scene layers tab, make sure your particle spawner is below your main actor.
@dimsdale there could be a slightly simpler way that, however I have never tried. If you are already constraining the main actors x and y for other reasons, you could have a non moving off screen actor creating the particles and under the position tab in the particles put them at the characters x and y and make it relative to scene. This way you don't need any added constraints.
Comments
I usually constrain another actor to the main one, in the layer below and put the particles in there.
e.g.
Player ship = main actor.
Make two variables (integer ones will do) - call them playerX and playerY
In your main actor use two constrain behaviours.
1. Behaviour: Constrain variable playerX to self.positionX
2. Behaviour: Constrain variable playerY to self.positionY
In your second actor (let's call it 'particle spawner') use another two constrain behaviours:
1. Behaviour: Constrain self.positionX to variable playerX
2. Behaviour: Constrain self.positionY to variable playerY
3. Behaviour: Put in your particle code here
4. Behaviour: Change self.alpha to 0
Now your particle spawner will follow your player around.
Put the main actor and particle spawner actor into your scene. In the scene layers tab, make sure your particle spawner is below your main actor.
Hope that helps!
QS =D
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
thanks @quantumsheep thought so, was hoping there was a simpler way that i missed
.
It's incredibly stupid, but you can't. Since the particle behavior is so limited, I usually just create separate actors for my particles.
@dimsdale there could be a slightly simpler way that, however I have never tried. If you are already constraining the main actors x and y for other reasons, you could have a non moving off screen actor creating the particles and under the position tab in the particles put them at the characters x and y and make it relative to scene. This way you don't need any added constraints.
www.rossmanbrosgames.com
@erockross, that's a really great idea!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@erockross, i see where your coming from, thanks. will have to have a play.