Who can help me with a physics type problem guys n gyals?

SparkyidrSparkyidr Member Posts: 2,033
edited November -1 in Working with GS (Mac)
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 :o)

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

  • mangaroomangaroo Member Posts: 419
    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)


    You could disable rotation that should keep him level (next to the moveable attribute).
  • CaniohCanioh Member Posts: 200
    You could also make it go slower the closer you get to the wall, so the direction change wont be so sudden. I guess that'll work, let me know if it does!
  • SparkyidrSparkyidr Member Posts: 2,033
    Yeah, I tried doing a thing where once he hit the platform, I constrained the rotation to 0

    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
  • PhoticsPhotics Member Posts: 4,172
    Sparkyidr said:
    Anyone got any super cool ideas?

    Nice graphics.

    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.
  • mangaroomangaroo Member Posts: 419
    Sparkyidr said:
    Yeah, I tried doing a thing where once he hit the platform, I constrained the rotation to 0

    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

    If you dont want rotation to always be zero, Id make two invisible actors a certain width a little before each wall and set the attribute rotation to 0 at that point - maybe 10-15 pixels wider than the wall on both ends so it isn't a last minute thing?

    edit: or the last part of the above post..

    When the square is touching the platform, just constrain it's rotation.


    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
  • SparkyidrSparkyidr Member Posts: 2,033
    @photics
    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.
  • mangaroomangaroo Member Posts: 419
    Yes sorry i just noticed - Have you tried messing with the drag attributes? perhaps even creating a magnetic effect for the platform - there is a good tip in a recent thread for that
  • iTouchGameriTouchGamer Member Posts: 681
    Maybe constrain the block to a position right above the platform?
  • SparkyidrSparkyidr Member Posts: 2,033
    @magaroo, there is deffo a difference in how much the topple effect happens dependent on the speed of the platform, but not sure if upping the drag factor would help me much, other then just slowing down the speed...which I can do manually....will have a look at this magnetic effect.

    @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 :o)

    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. :(
  • mangaroomangaroo Member Posts: 419
    let us know if you fix it, im curious how to solve that - what about drag just on the blocks not the platform so they are more stable

    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
  • iTouchGameriTouchGamer Member Posts: 681
    mangaroo said:
    let us know if you fix it, im curious how to solve that - what about drag just on the blocks not the platform so they are more stable

    Yea, I would like to know as well lol. Keep us posted!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    have you tried somethign like when self rotation > 0 change self rotation to 0, then othewise change rotation to 0.

    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
  • PhoticsPhotics Member Posts: 4,172
    Sparkyidr said:
    @photics
    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

    What's the friction on both actors?

    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.
  • SparkyidrSparkyidr Member Posts: 2,033
    >What's the friction on both actors?
    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.
  • SparkyidrSparkyidr Member Posts: 2,033
    @phtics again :)

    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.
  • PhoticsPhotics Member Posts: 4,172
    Sparkyidr said:
    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.

    It's not killing the acceleration. It's changing it. That might be manageable, as it could be toggled when the actor is on a platform... and multiple platform acceleration points could be managed with game attributes. (I tend to avoid editing scene attributes.)

    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.
Sign In or Register to comment.