Actor shadow copies main actor movements
Zombiebrains
www.zombiebrains.co.ukMember, PRO Posts: 296
Hi guys
I have a main actor and a shadow actor and I need the shadow actor to copy what the main actor does.
The shadow actor sits underneath the actor.
I need it so whatever movement the main one does the shadow copies...this includes moving up and down and also rotating.
The actors are two tank shapes actors and the game is a top down view.
I have a main actor and a shadow actor and I need the shadow actor to copy what the main actor does.
The shadow actor sits underneath the actor.
I need it so whatever movement the main one does the shadow copies...this includes moving up and down and also rotating.
The actors are two tank shapes actors and the game is a top down view.
It takes a Zombie to know a Zombie!!!
This discussion has been closed.
Comments
Could you constrain the actor to your main player? Or would it be easier to just add a shadow in Ohotoshop? Then you know it'll work.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Yeah I could add a shadow in Photoshop but really wanted a separate actor as I wanted if possible a series of them, say up to 4 do it looks like a snake effect.
It takes a Zombie to know a Zombie!!!
REAL Attributes:
ActorX = 0
ActorY = 0
actor: constrain self.position.X = actorX
constrain self.position.Y = actorY
Shadow: constrain self.position.X = actorX
constrain self.position.Y = -actorY-(height of actor)
Make sure to set your shadow's alpha to around .3 that should make a nice shadow.
good luck
Thanks a million for that workout....will try that later.
Will report back if it works!!!
It takes a Zombie to know a Zombie!!!
I found an easier way....
I now spawn my shadow actor underneath my main actor every1 second then destroy it. It is also locked to my main actors x, y and rotate attributes so. Now it copies every move my main actor does.
Thanks again for the ideas.
It takes a Zombie to know a Zombie!!!
You have the first set of constraints backwards ! As it stands everything is constrained to zero.
It should be:
actor:
constrain actor X to self.position X
constrain actor Y to self.position Y
You might want to 'recylce' the shadow actor rather than go down the spawn and destroy route if it's happening every 1 second.
In all seriousness, with global warming aside, Mr Environmentally Friendly is correct, recycling will by far be the best option for smooth performance.
Ace
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Hi guys
I use spawn and destroy quite a bit...how does this 'Recycle actor' thing work?
Not heard of that...any examples would be great and any trick to speed up performance is a bonus
It takes a Zombie to know a Zombie!!!
@Zombiebrains Please don't revive old threads (this one is two years old).
Plus, this information is not valid any more. It's fine to spawn and destroy. If you did want to recycle actors, you just move them back to their original starting point after you are done with them.
/closed.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User