Spawn, translate across the screen and rotate
HulaPig
Member Posts: 5
Trying to get an actor to spawn from the right side of the screen, continuously rotate through 360 degrees as it translates across the screen unless it hits a specific actor. The rotating actor will spawn correctly and appear on screen rotating, but after about 40-60 pixels it travels in the direction it came from back off screen and just repeats this loop. If I turn off the rotation then it translates across the screen just fine. Any thoughts as to the stupid mistake I have made?
Comments
Make sure your Rotate behavior is set to Relative to scene.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Not using Pro, don't see that option for my "Rotate" attribute. Currently set for "Counter-clockwise" at a speed of 200.
It's not a pro feature. I don't use the windows version but on the macintosh there is a drop down menu to choose 'relative to' actor or scene.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
It is in the Move behaviour that you are using where you need to change Relative from 'actor' to 'scene'.
Sorry, my mistake. That's what I get for trusting my memory!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
OK, I have the "Move" attribute set to translate the actor across the screen, right to left, at 180 relative to scene, move type is additive. Then I used the "Rotate" attribute to spin the actor. Seems when I introduce the "Rotate" attribute is when the troubles start. If needed I will gladly pull everything else out of my file and just save the actor and post the striped down version if that would help.
Yes, that would help.
These behaviors:
Should produce this:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
[Steals idea for StrawberryNinja™]
@Socks, it was the subliminal "Should produce this" that must have enticed you.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
OK, got it working, Thanks Socks! Now my other issue. It translates fine, when it gets to the lefthand side the random spawner works and it appears again on the righthand side. Here's the second issue: I now have an actor blocking the path. I want to destroy the spinning actor if it hits the stationary actor (that works fine), but respawn it on the righthand side again at a random time. That part doesn't work. My question: It seems as though I need two spawn rules, one if it translates across the screen and one if it is destroyed. Is this correct? I have both but the destroyed rule isn't working.
Sorry tatiang, meant to give you credit on that one but was too focused on my text.