A better way to do this?

UtopianGamesUtopianGames Member Posts: 5,692
edited November -1 in Working with GS (Mac)
Hi Guys,

Started on a new project and i have an actor (the fishing net) that follows mouse x & y when touch is pressed BUT i want to rotate the actor when my finger moves around.

Atm i have Rotate to Position game.Mouse.Position.X, game.Mouse.Position.Y speed 2000 relative to scene.

Im 70% happy with the results but when moving slow or after holding my finger down for a while it doesn't seem to rotate as i want.



Darren.

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    The only thing I can think of is make sure 'stops at destination' is turned off in the Rotate behavior.

    What is it doing that you don't like when it moves slowly?

    Game looks great so far!
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    It would be nice if you could track velocity on a constrained object! Then you could extrapolate the direction and use it in the vectorToAngle function to control your rotation.

    Feature request?
  • vegasmike1vegasmike1 Member Posts: 192
    I would make the NET flatter, like one you might find used in a home aquarium I think your code to do what you are doing is working pretty good, but the net is so long that it makes any problems more obvious,,,2cents with change
    mike
  • UtopianGamesUtopianGames Member Posts: 5,692
    FMG yes stop on destination is turned off.

    Don't like how its not rotating to direction properly sometimes although i will try and make it smaller with animation to see if it helps.

    Thanks guys,

    Darren.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    It also might be looking weird to you because the net graphic is centered?

    So its rotating around its center pivot instead of the top of the net?

    You could try adding some transparent pixels to the top of the .png, or set the graphic type to fixed and increase the size?

    Unfortunately that also increases the net's size...
  • eaguirreeaguirre Member Posts: 89
    Agree with Joe (FMG) some gap with transparent pixels, but create an invisible actor the size of your desired net (this actor will be the one that collides with the fish) and the net image that follows the invisible actor. So the net image will rotate as desired.
  • RHRH Member Posts: 1,079
    BarkBarkCo said:
    It would be nice if you could track velocity on a constrained object! Then you could extrapolate the direction and use it in the vectorToAngle function to control your rotation.

    Feature request?

    +1, this always bugs me!
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    @utopian, Let me know if this works for you:

    http://gamesalad.com/game/play/72498
  • UtopianGamesUtopianGames Member Posts: 5,692
    Thanks m8 it works great!

    I used scene gravity to pull fish back down, so now i will have to try another method.

    Might be the reason why it wasn't working great at the start (because of gravity)

    Darren.
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    You should still be able to use scene gravity if you want to. It shouldn't effect the net or any other position constrained actors.

    I know most ppl here prefer to use accelerate behaviors instead of scene gravity though.
Sign In or Register to comment.