Gravity + Drag Actor

Hi guys!

My game is going well, I have created 30 levels. But now I want a bigger scene so that I can add more actors and more fun.
I followed T-Shirt-booth's tutorial so that I could create a "drag-actor" and a "cam-actor" and move around the scene.

However, I use gravity for about everything in my game. And when I hit preview, my drag actor falls down. If I set it to "not movable", the drag function won't work. Many of you would recommend to remove gravity and have an accelerate-behaviour on every actor. My question is if there is another way around it? The gravity function is perfect for my game, and it's not a problem using it except the drag function. Any clues?

I could possibly constrain the drag-actor to move along the x-axis since my gravity goes along the y-axis, but is it possible to move both ways without messing up gravity?

Thanks in advance!

Sincerely Nico

Comments

  • NicodahlNicodahl Member Posts: 14
    Anyone?
  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    Well iv got two suggestions
    1) would be to constrain your movable actor to a certain x position so that gravity doesnt effect your actor that you want to move.



    2)
    my second suggestion would be to create a new actor and make it invisible, make this actor non movable, and go into this new actors physics and turn density, friction and bounciness to 0.

    go into your moveable actor and make a collide behaviour.
    make it collidable with the invisible ground.
    go into the moveable actor and also turn friction, bounciness and density to 0.

    now this invisible actor will act as a ground, so when your moveable actor falls because of gravity, it will hit this invisible ground, therefore staying there and not falling.
    now make sure this insivible actor is strecthed across the screen to where ever you want your scrollable actor to go.


    there just two options. option 1 is alot more simple just to point it out.

    hope this helps!
  • NicodahlNicodahl Member Posts: 14
    Thanks alot!! Will check it out:) have a wonderful xmas!
Sign In or Register to comment.