Making Objects Abide Physics, but Not be Moved by Other Actors

ADSentertainmentADSentertainment Member Posts: 397
edited January 2014 in Working with GS (Mac)
I have a boulder actor in a project, and I have it use the physics engine so it can roll and fall like boulders do, however, I want it to also UNPUSHABLE like a boulder. I don't want my actor to be able to move the boulders. Or be able to throw anything that can move the boulder. I know I can turn off the Movable attribute, but again, I still want it to be able to fall and roll like boulders do in the real world. Does anyone have an idea of what I can do?

Having trouble with your game? Sounds like a personal problem.

Answers

  • 3itg3itg Member, PRO Posts: 382
    edited January 2014
    Have you tried playing with "Density" in the Physics tab of the actor?
    If you make it REALLY dense, or "Heavy" and other actors are very light, I believe this will accomplish what you are looking for.
    Also, boulders arent very bouncy, so turn down "Bouciness".
    Friction and drag stuff will mostly be for when in motion, but those might also help you accomplish the over all feeling of a Boulder.
  • TouchiMediaTouchiMedia Member Posts: 154
    edited January 2014
    I think the DRAG attribute is what you want to set really high, and maybe DENSITY or FRICTION. That or when boulder collides with (object or tag) - set x-linear speed to 0-3 (very minimal).. Try experimenting with that
  • ADSentertainmentADSentertainment Member Posts: 397
    Have you tried playing with "Density" in the Physics tab of the actor?
    If you make it REALLY dense, or "Heavy" and other actors are very light, I believe this will accomplish what you are looking for.
    Also, boulders arent very bouncy, so turn down "Bouciness".
    Friction and drag stuff will mostly be for when in motion, but those might also help you accomplish the over all feeling of a Boulder.
    That is actually exactly what I did. I put it to the highest setting possible (9,999) and something with a density of only 1 was able to move it a bit.

    Having trouble with your game? Sounds like a personal problem.

  • ADSentertainmentADSentertainment Member Posts: 397
    I think the DRAG attribute is what you want to set really high, and maybe DENSITY or FRICTION. That or when boulder collides with (object or tag) - set x-linear speed to 0-3 (very minimal).. Try experimenting with that
    I don't want the friction to be too high, since my character in the game treats the boulder as a solid that can be walked on, a high friction would slow him down, I'll see what I can do with drag, though.

    Having trouble with your game? Sounds like a personal problem.

  • 3itg3itg Member, PRO Posts: 382
    edited January 2014
    Well, if you got something close, where the player was only able to move it a little bit. Try adding a Boolean (or figure out a true/false condition based on other stuff) and then simply make rule.
    Add a rule or two, to the boulder.
    When the player is touching the boulder, make it true.
    Otherwise, its false.

    When its true, Boulder(Self.Physics.Movable = false)
    otherwise (Self.Physics.Movable = true)

    (you could also constrain its coords, set its velocity to 0, add min(max()) to coords to stop it from moving if your game logic really forbids using Movable. )
  • ADSentertainmentADSentertainment Member Posts: 397
    Well, if you got something close, where the player was only able to move it a little bit. Try adding a Boolean (or figure out a true/false condition based on other stuff) and then simply make rule.
    Add a rule or two, to the boulder.
    When the player is touching the boulder, make it true.
    Otherwise, its false.

    When its true, Boulder(Self.Physics.Movable = false)
    otherwise (Self.Physics.Movable = true)

    (you could also constrain its coords, set its velocity to 0, add min(max()) to coords to stop it from moving if your game logic really forbids using Movable. )
    I was thinking of the first idea, but it would lead to a few complications, still.

    Having trouble with your game? Sounds like a personal problem.

  • RainbrosRainbros Member Posts: 124
    I was searching for an answer to this problem as well, but it looks like the only thing you can do is to set the density VERY high (in the millions/trillions). I'm not sure why you say that 9,999 is the highest possible density, I just set the density in an actor to 1 plus 15 zeros, and it simply displayed the number in scientific notation. It still isn't a perfect solution (I've noticed that, as you said, even with these extremely high densities, even an actor with a density of 1 can somehow move it a tiny amount.) I wish GS would just add an "Able to be pushed" boolean like Stencyl has, but until then, I don't see any other option.
  • ADSentertainmentADSentertainment Member Posts: 397
    @Trunks huh, it works now, earlier it would only go to 9,999. Interesting, I'll see how that works now.

    Having trouble with your game? Sounds like a personal problem.

  • AJJ544AJJ544 Member Posts: 6
    Well, if you got something close, where the player was only able to move it a little bit. Try adding a Boolean (or figure out a true/false condition based on other stuff) and then simply make rule.
    Add a rule or two, to the boulder.
    When the player is touching the boulder, make it true.
    Otherwise, its false.

    When its true, Boulder(Self.Physics.Movable = false)
    otherwise (Self.Physics.Movable = true)
    I was thinking of the first idea, but it would lead to a few complications, still.
    I don't quite understand what the problem would be. Maybe I'm having trouble envisioning your game. Mind to explain a little more. I think ADS's idea is perfect but maybe I'm just missing something.

    It would seem you could use that rule he said above, and apply it to everything that shouldn't be able to move the boulder. Players, smaller boulders, clouds..whatever it is, just make the moveable value false when in contact with actor "ground". Something along those lines.
Sign In or Register to comment.