Hi,
I have bubbles coming out of a fish, and the fish is on a path, with the whole sprite turning from left to right, but I need the bubbles to always be coming out of the front of the fish (ie the head), but when the sprite turns they are still only coming out from one end and do not flip round.
Any way I can easily do this?
Thanks!
Comments
Is it childed to the fish?
Try to set new position to the bubbles when turns occur.
If bubbles are animated sprite sheet. Try to make a copy of it and set opposite position and then call object visibility on and off left and right bubbles when fish turns.
You should have 4 animations and 4 animators.
Fish swims left, swims right, bubbles left , bubbles right.
Then child and position bubbles left to fish swims left accordingly to the head. Do the same with Fish swims right and bubbles right.
After you can call what animations you want to play with your actionlists. And set positions to where you want your fish move or just move it if it is a Player.
If your fish is not a Player or NPC e.g. just fish that swims back and forth and has nothing to do with the gameplay.
Then you can create 1 fish swims animation and 1 bubbles animation.
In total this time you would have 2 animators and 2 animations.
Add your fish swims sprite sheet animation(atlas) and set positions where it moves .
If left add fish swims left sprites, when it turns add fish right sprites ( add turn animation sprites if you have them, if you dont have them , you would need to flip it's Roatation Y by 180 degrees or Scale it's X to -1 )
If you make it as a loop make sure to add your sprites correctly so you have a nice seamless loop.
Then add sprites of your bubbles animations and animate them( this is gonna be a bit of work if you have only 1 bubble and want it to be animated e.g. fade it in go up ad fade out or burst, that's why to go with a particle emmiter would have been better)
Remember to set the same animation length to the fish swims and bubbles!
After you bubbles animation is set child it to you fish and position it to it's head, then add 2 more new positions chnage it slightly and move to fish's head when you fish tunr on the left and on the right.
This is actually a Unity related issue and not AC. By all means you are free to post it here. Just take into account that in Unity forum you could get better answer.
Can't see your picture since dropbox asks to log in.