Accelerometer display actor within given part of the x, y, z scale?
Hi guys,
I'm playing around with the accelerometer in GS for the first time ever (late to the party, I know). Rather than creating a ball-type actor that rolls around, what I've done is ask it to display text when the accelerometer hits a certain point (eg. -1 on the x scale).
Problem is that it hits x -1 very briefly and then moves on to another part of the scale (and I want to do this for multiple different areas not just x -1 of course), so instead I want to say 'if accelerometer is on a scale between -1 and -5 on the x axis, display this text only until the accelerometer is no longer in that area'. How do I specify a real number area like that, where it will display for the whole time that it is in that area?
Oh and for context: eventually I want to replace the display text function with the displaying of an actor but I don't want it to just spawn over and over again like crazy while the accelerometer is within that point scale (which it does when using spawn actor function), I'd love it to just switch to that actor and stay there, then switch to something else when it is no longer in that area on the scale. So at present I'm thinking the best way to do this is to set up each actor on a boolean attribute that turns on and off. I'm just about to test whether this actually works like I'd hoped or not.
Does anyone have any advice? Cheers
Comments
It's been awhile since I messed with the accelerometer but I don't think that matters too much. I think something like this should work.
In a Rule:
When All conditions are valid:
if accelerometer is < -1
if accelerometer is > -5
Display the text
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thanks @jamie_c that seems to be working well! With the gs phone viewer never working it is just such a faf-around to test accelerometer stuff that it's working that it takes me ages to do even the smallest thing 🤣
I'm glad it's working! :)
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
The all-Apple combo (Mac + iPhone) is best for using the Viewer in my experience. It's difficult hitting the Android Device Specs +OS lottery with the Android/Windows and even Android/Mac combos.
GameSalad Templates and Custom Development at the Official Marketplace: http://gshelper.com