Have a character actor and shadow actor spawn together
Hey everyone,
Right now I have an actor that moves back and forth across x that spawns a character actor every half second. I have it spawning a shadow actor at the same time as well. I made 2 real attributes that have the characters x and y coordinates associated to it. I then have the shadow actor's x and y positions constrained to the x and y attributes so they move and follow the character. So far it seems to be working but the shadow actors always spawn on top of the character actor and even multiply on top of themselves making the shadows darker as they accumulate.. When I have it spawn behind the actor or behind the layer, the shadow actors disappear. I've tried creating a separate actor to spawn the shadows but it does the same thing. the shadows either disappear or cover the character actor. Does anyone know how I can have the shadows always spawn behind the character actors correctly? Thanks!
Answers
Hi @AtomicFX Off the top of my head, make the actor that moves back and forth across the x spawn only the character actor; then have the character actor spawn its own shadow actor behind it - which i easy to choose in the spawn behaviour (with a position offset to the Constrain attribute behaviour of the shadow).
Should work...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Thanks gyroscope, but I tried that too and the shadows still disappear. You can see them pop on really quick at the spawn point and then they disappear. The only way that almost works, that I've found, is spawning the character and shadow together but then I get weird issues where the shadows overlap the character and then some keep accumulating more shadows on top of each other.
Hi, what are your settings in the Constrain Attributes for the shadow (its x and y)? you need offsets on the x and y to see the shadow....
As for the accumulating shadows, not sure why that's happening if any character actor (with its shadow) should have moved away from the spawn point by the time the next actor and its shadow are spawned...
Bit tired tonight - I'll maybe try a test tomorrow now if you can supply a bit more info about what's in your constrain attributes for the shadow actor.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Character:
I have 2 real attributes game.characterX and a game.characterY.
The attributes are constrained to the characters positions in x and y.
Shadow:
Constrain self.position.x to game.characterX.
Constrain self.position.y to game.characterY-112 (offset to make the shadow further away)
Also, the only way to have the shadows follow each spawned character is by having the spawn setting for both to be (Behind Actor) otherwise the shadows disappear.
But that's right- if you change it to anything else - like Back of Layer, it'll probably disappear behind a background image you have... (at a guess)...
So can't see why the worry now, to be honest - the shadow with your y offset all done; spawned in back of character actor all done...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Yeah but there's still the issue with some shadows accumulating on top of each other and the other issue (not as big) is that the shadows of some characters will overlap other character actors. Maybe the first issue is just a bug.
@AtomicFX - shadows accumulate on top of each other? You mean the same shadow? Did you try a boolean to ensure only one shadow has been spawned?
My Blog / App Store / Google Play
Every half second I have a character actor and a shadow actor spawn at the same time. I have the shadow actor constrained to the characters positions but when I test it out the shadows all spawn correctly but as the time goes on some of the shadows get darker because they begin to pile up on top of each other even after the original spawn. It doesn't happen to all of them which is weird.