Rules not working for off screen actors...
imjustmike
Member Posts: 450
What I want to happen is the actors to move onto the screen, then move left and right within set parameters, essentially going left and right. My set up is pretty simple:
In the actor I have created a start_x attribute, which changes the self.x on start/reset so that I can reload the actor positions without changing scene. Since I'm working to iPad resolution the start_x is either 100 or 800 depending on if the actor is left of the screen or right.
Also in the actor I have a rule that says if the actor's x is lower than or equal to 100, change velocity to direction 0 (right) and increase acceleration, so that it starts moving. I have an opposite rule set to if the self.x is equal or greater to 650.
The only way I can get this to work is if the start_x actually has the actor visible on the screen. Otherwise the behaviours just don't kick in. I've never come across this behaviour, where actors seem to ignore rules and behaviours if they're not on the visible screen. Don't suppose anyone might know what's happening?
In the actor I have created a start_x attribute, which changes the self.x on start/reset so that I can reload the actor positions without changing scene. Since I'm working to iPad resolution the start_x is either 100 or 800 depending on if the actor is left of the screen or right.
Also in the actor I have a rule that says if the actor's x is lower than or equal to 100, change velocity to direction 0 (right) and increase acceleration, so that it starts moving. I have an opposite rule set to if the self.x is equal or greater to 650.
The only way I can get this to work is if the start_x actually has the actor visible on the screen. Otherwise the behaviours just don't kick in. I've never come across this behaviour, where actors seem to ignore rules and behaviours if they're not on the visible screen. Don't suppose anyone might know what's happening?
Comments
Beyond that, I'd have to see your exact rules to know why it's not functioning correctly.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I'll give it a go tonight, though I'd be surprised if that was the case as I've had actors be a lot further off screen in other builds without any issue.
Two ways of handling this:
1. Increase your scene size and place those actors so they are outside the screen/camera area but inside the scene.
or
2. Minimize the size of those actors, place them so they fit within the grey area outside of your current scene size and add rules to those actors that changes their size, to their correct values, when that scene starts.
@JSproject - I've been using double scene sizes for a while for my menu systems, I'm pretty OCD so like having the room to lay things out nicely, but I really like the idea on using rules to change actor sizes - could even have them interpolate up to the right size, might be a nice effect.
Yeah, interpolate to correct size produce a nice effect in some cases.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User