ball collision with a barrel? RESPAWN each time.
feroman
Member, PRO Posts: 130
I ask for help for my little complex game.
My "player" is the ball.
The ball must go into the barrel.
At collison each of these actors, the ball must disappear from the screen, because the ball is inside of the barrel.
so far, everything is normal.
Then I touch the screen, the ball must be eject of this barrel!
But how? because the ball had already disappeared during his colision with the barrel?
In my code, the attribute of the ball is "change attribute" if collision with barrel.
if touching the screen, I did "Spawn actor BALL" does not work because the code auparvant demand destruction it soon.
Help me with another more complex coding, and easy to manage, because in the scene, I have other barrels.
Comments
Instead of destroying the ball on collision, you can change it's alpha to 0. When you want to eject it just change the alpha back to 1.
Put the barrel actor on a layer above the ball actor. Then the ball will naturally appear to go behind/inside the barrel and you'll never have to delete it.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page