Turning off physics
HappyKat78
Member, BASIC Posts: 173
Hi,
Like many people I'm not using the scene gravity, rather accelerate downwards on each actor to trigger physics. However, once the level is complete I want all of the actors to stop where they are (while I show a popup level complete window). I've tried turning off moveable, making the acceleration 0, and the only way I can get this to work is when the level complete is triggered I load two local attributes (LockX and LockY) with the current X and Y of the actor and then constrain the actor's actual X and Y to the respective local attributes. This works fine but I'm obviously setting up quite a few constrain attributes which I know are memory hogs.
Does anyone have a less memory intensive way of stopping the physics once it's started?
Thanks,
HK
Like many people I'm not using the scene gravity, rather accelerate downwards on each actor to trigger physics. However, once the level is complete I want all of the actors to stop where they are (while I show a popup level complete window). I've tried turning off moveable, making the acceleration 0, and the only way I can get this to work is when the level complete is triggered I load two local attributes (LockX and LockY) with the current X and Y of the actor and then constrain the actor's actual X and Y to the respective local attributes. This works fine but I'm obviously setting up quite a few constrain attributes which I know are memory hogs.
Does anyone have a less memory intensive way of stopping the physics once it's started?
Thanks,
HK
Comments
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
you may also want to change angular velocity whilst there to 0 as well
if you are applying downwards acceleration, you will need to stop that too
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
When gravityOn? is true
---Accelerate 270
otherwise
---Timer , After 0 seconds
-----Change Attribute: Self.motion.LinearVelocity.Y To: 0
Timers are kind of resource hungry as well. But it does slow down the processor enough for 'momentum' to come to a complete halt before GS moves to the next instruction.
Lump Apps and My Assets
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
)
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
As for you having been 'fooled', no one 'fooled' you or 'tricked' you into doing anything, your actions are your own responsibility, you simply ran into trouble for being unnecessarily aggressive.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Back on the topic and knowing what Mr. Bacon had to in order for physics to stop in our game (which there was a butt-ton of), I think he's got an idea what's going on here.
I think there is a wonderful example of 'can give it, but can't take it' here, FBS' unnecessarily sarcastic contribution to a previous thread is apparently all good and well, but when the boot is on the other foot (and addressed using his own words) it suddenly becomes 'oneupmanship' ?
Lol, but I do admire your dogged loyalty even in the face of such poor logic, hey but when there is little logic to your argument feel free to do the whole 'something stinks', 'insecurity', 'oneupmanship', 'negative', 'can't even be wrong', 'questionable avatar' . . . ad hominem route, it's better than nothing.
How old are we lads? This is going on for a bit now. Either get over it or get a room
If there was any instance that you could have cleared up a misunderstanding (sarcasm included) with FryingBaconStudios, you could have done it in you second post, which you did not. Instead, you played the victim card (looks to me as you took a shot right from the start). Oh, and sweet pea, it's not just this thread.
Loyalty has nothing to do with it. I saw you doing "your thing" again and called it out. Don't try to group me because of what I said, this is not a mob (victimizing tactic #2). This is me, to you...dude.
As for the rest, use that brain power you have and think about what I said (and where it may apply), instead of assuming your are vastly more intelligent than everyone else.
I'm done on the topic.
Sorry @beefy_clyro but I'll address things as I see them. It's not an age factor, not that, that matters AT ALL on these forums. I don't find the situation amusing. A Sous can clean up the thread and keep it strictly on topic. I'd keep it to PM, but when I see something occurring at the source, I'll call it out right there. I've said my piece and that's that. Moving on...
@all I apologize to all from contributing to off-topic and turning this thread into an unpleasant mess.
Honestly if you feel I've done anything wrong, something you can actually articulate, then come out and say it, I'd be happy to clarify any misunderstanding. In the meantime I'd drop the insults, they're not getting you anywhere.
And if you'd like to discuss this via PM I'm happy with that too.
>-
How'd that workout?
I've had to use the move behavior = 0 with stacked turned on to get things fully stopped. As mentioned in the thread earlier, you'll have to kill the accelerate behavior first.
Anyways, if you don't want the added bulk of a timer, you can also adjust max speed to get things to stop quickly.
Go into the actor's Motion settings and check "Apply Max Speed". Then make a rule that works something like this:
When gravityOn? is true
---Change Attribute: self.Motion.Max Speed To: 500
---Accelerate: 270, Speed: 500
otherwise
---Change Attribute: Self.Motion.Max Speed To: 0