Issue With Physics

TWEAmazingAppsTWEAmazingApps Member Posts: 219
edited April 2012 in Working with GS (Mac)
Hello I am having a small issue. I created 4 attributes called. Up,Down,Left,Right. For touch controls. I made a GUI interface with arrows going up,down,left, and right. And in it I made code for each of them saying.... For the right button I created a rule. When actor Receives touch inside. Then game.Up is False, game.Down is false, game.Left is false, Change Attribute game.Right is true. And then i created another rule. When actor receives event (Key) ,Right, Change attribute game.Right True. So everything works for up,down,left, and right. The character moves. BUT when I try to put drag on the character it dosent do anything. I am using Accelerate when I move the character but the character just keeps going for a long time then it will bit by bit slow down but. I want it to slow down faster. I used the move attribute but i dont like how he suddenly stops I want more of a underwater feel with the physics. Is there any solution to this problem. Thank you!!!

Best Answer

  • jonmulcahyjonmulcahy Posts: 10,408
    Accepted Answer
    First of all, simplify your move rules

    On each actor have something like this
    (for the up actor)
    When actor receives touch
    Game.UP is true
    Otherwise
    Game.up is false

    This way you can move in the diagonal.


    As far as movement goes, what's your acceleration like? How does the player move? Is it like a fish under water where it moves in all directions, or a person walking on a street?

Answers

  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    @jonmulcahy Alright thank you for the tip ill do that. And its a jellyfish under water it can move in all directions. But for some reason I cant add the drag in. Its very weak.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    If you add drag, I think you might have to increase the density of the object to counter it. Try playing around with that number.
  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    @jonmulcahy well its no deal. I upped the density to 80 and drag to 40 and angular drag to 40 and messed around with some numbers. I even put it to 2000 nothing really happend he is just gliding like nothing is on him.
  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    edited April 2012
    Never mind everyone I figured it out. I just go into my character and use (Change Attribute) Self.Physics.Drag to 60 and Add another (Change Attribute) Self.Physics.Density to 100. It works great now.



    thank you for helping me out @jonmulcahy and for your time.
Sign In or Register to comment.