Who can help me with a physics type problem guys n gyals?
Sparkyidr
Member Posts: 2,033
Here is a video.
See the little square guy on the platform? He's pretty happy moving along with it, I have set the friction pretty high on both objects, and he sticks to it.. woo. Job done I hear you cry.
That is until the platform changes direction, and the force makes him tip over.
Any ideas on stopping that (hopefully without constraining stuff at the scene level if poss)
I've tried a changing friction values and density values, but neither seems to make much of a difference.
If the friction is too low overall the guy doesn't stick to the platform as it moves
I tried setting the density stupidly high on the block guy, and constrained the y of the platform to stop it being shoved down, but it still seems to behave in the same way.
Obviously, setting the platform moving slower, makes the wobble less violent, and faster makes it so harsh, that the guy just rolls off )
I am using a move to on the platform to make it move. I am using accelerate to simulate gravity on the block guy.
If I were using interpolate, I could use ease in and out to make the direction change smoother.....but the problem with that is, the block guy doesn't stick to the platform, no matter what the friction is set to.
I can set the friction to 100000 on both the platform and the block, and he hits the platform, but it just carries on sliding under him. And yes, that's with moveable checked also.
Anyone got any super cool ideas?
See the little square guy on the platform? He's pretty happy moving along with it, I have set the friction pretty high on both objects, and he sticks to it.. woo. Job done I hear you cry.
That is until the platform changes direction, and the force makes him tip over.
Any ideas on stopping that (hopefully without constraining stuff at the scene level if poss)
I've tried a changing friction values and density values, but neither seems to make much of a difference.
If the friction is too low overall the guy doesn't stick to the platform as it moves
I tried setting the density stupidly high on the block guy, and constrained the y of the platform to stop it being shoved down, but it still seems to behave in the same way.
Obviously, setting the platform moving slower, makes the wobble less violent, and faster makes it so harsh, that the guy just rolls off )
I am using a move to on the platform to make it move. I am using accelerate to simulate gravity on the block guy.
If I were using interpolate, I could use ease in and out to make the direction change smoother.....but the problem with that is, the block guy doesn't stick to the platform, no matter what the friction is set to.
I can set the friction to 100000 on both the platform and the block, and he hits the platform, but it just carries on sliding under him. And yes, that's with moveable checked also.
Anyone got any super cool ideas?
Comments
And it stopped the block guy from rotating, but it also had the odd effect of when the platform changes direction, he does a weird little shimmy, where it looks like he is trying to rotate, and then levitates a little and shimmies some more before eventually settling. Not really a clean enough work around for me.
I don't want to turn fixed rotation on for that object, as I still want it to rotate if you clip the side of the platform for example.
Can you turn on snf off fixed rotation at run time in a rule? (I had always assumed it was one of the things you couldn't change) << edit you can't
Have you tried using a different shape for the platform? Perhaps something concave would work. To that you might respond, "But Mike, GameSalad doesn't support such shapes. Yet, you could constrain lots of angled lines to create a concave shape.
That won't solve the problem, but perhaps this will...
When the square is touching the platform, just constrain it's rotation.
edit: or the last part of the above post.. however that would cause a problem with any other actors stacked above it
edit: probably make it less than 10-15 pixels, more like 5, otherwise (if things stack) they won't fall off the top like a cool game should....however when you build up quite a few actors the ones who dont touch the side might cause a bit off a mess..could be fun - points based on how many you could stack
to be honest watching the video again, id do something else
Yeah, I tried the constraining of the blocks rotation when it was on the platform.. but I still get this an odd levitation and wobble about a bit effect when the direction change happens.
I then tried it with a boolean, wich was set to true once it has hit the platform, and then constraining the rotation to 0 when that is true
This gives a slightly different levitation effect as the direction change happens :
@mangaroo, there are no walls. I am changing direction based on the platforms x pos. But even so, I'm not convinced that would solve the issue anyways, as constraining to 0 gives the above effect anyways.
@iTouch, I could...but I am trying to avoid it if poss, just to make my life simpler when I have a level with like 15 platforms )
I think my best bet, is to "code" my own ease in and ease outs for the platform movement.
I just wish the collisions worked the same when using interpolate to move it.
guide to helping with the magnitude for distance to allow some magnetism incase the drag on actors isnt working either
http://www.youtube.com/user/GameSaladCookbook/#p/search/0/_p2s61XVZ0o
this is one of those pesky problems that your just gonna have to try everything you can come up with, sorry couldnt be more help
You could constrain the X & Y velocity of the actor while it's on the platform, but then it would be hard to leave the platform.
So, you could do this...
If on-platform is true
...and overlap with another square is false
...constrain X velocity, Y velocity and Rotation to zero.
That's not exactly bulletproof though.
Are you using Gravity or acceleration? If it's acceleration, you could have the actor accelerate to the point where it touches on the platform.
If overlap or collide with platform
accelerate X to platform.x + offset from center
accelerate Y to platform.y
The offset is set when the platform is first touched.
I've got it set to 100000 at the mo as I was testing
>If on-platform is true
...and overlap with another square is false
...constrain X velocity, Y velocity and Rotation to zero.
just tried that (but without constraining the x vel to 0 so it carries on moving left and right with the platform.
It's deffo better, but still moves and slides around a bit as the platform changes direction. Even with my stupid friction values.
Thanks for getting stuck in with me mate. Much appreciated.
I'm trying (if poss) to stay away from any scene level stuff. Your idea with killing the acceleration as it hits the platform is great....but would be a little confusing if I had a level with a load of platforms rather then the one.
But here's something that might work better...
Change the actor's velocity when the platform velocity changes, matching the change in direction. That might break the inertia.