Get the Linear velocity (Drag actor)

sebmacflysebmacfly Member Posts: 1,018
edited November -1 in Working with GS (Mac)
Hi there!

I need to get the linear velocity from an actor dragged by my finger...
I can't get it, he's always 0...
Any help on that?

Thank you!

EDIT : Only need the Linear X velocity, not Y.

Comments

  • sebmacflysebmacfly Member Posts: 1,018
    No way... when i drag it with my finger, i can't get the velocity value...

    What i'm doing wrong?

    thanks

    What i'm doing :
    -Contrain actor attribute to magnitude(self linear velocity X, Self linear velocity Y)
    -Display the constrained attribute.
    -> The result is always 0

    :(
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    constrain is not viewed as movement by the physics engine.

    you will need to compare the the starting x and y values to the ending x and y values and the time it took to complete that constrained motion.

    Doesn't Joe (FMG) have a throwing demo? I think that will put you on the right track.
  • sebmacflysebmacfly Member Posts: 1,018
    Hi Scitunes, thanks for your answer.

    I want to make a wheel, to place bet for my poker game.
    The wheel is the actor i need the velocity, because the more sh's fast, the more i'll bet.

    For example :
    Velocity 1 to 10 => Bet=Bet+10
    Velocity 11 to 50 => Bet=Bet+100
    Velocity 51 to 100 => Bet=Bet+1000
    Velocity >101 => Bet=Bet+10000

    Maybe other solution to make that?

    You can see my whell here :
  • ValanValan Member, BASIC Posts: 410
    You could link the count it to the x distance an actor travels.

    The actor moves when pressed and has inertia.
  • sebmacflysebmacfly Member Posts: 1,018
    Can you explain a little more please?
    I don't understand what you're trying to make...
    Thanks
  • sebmacflysebmacfly Member Posts: 1,018
    UP... Still need help
  • sebmacflysebmacfly Member Posts: 1,018
    Tshirtbooth, Utopian, and other pros here... can you help me please?

    I'm out of ideas about that.

    thanks a lot!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Like sctunes set your problem is that constrain isnt effecting the physics so it doesnt have a velocityl. Its just constantly updating its position to what its constrained to

    youll need to make 2 attributes like startbet and bet result. Bet result should be a real attribute

    HAve a rule in the bet ring when touch is pressed change start bet to 1

    Have a rule when touch is relesed change start bet to 0

    Have a rule when start bet = 1 every .1 seconds change bet result to bet result+0.1

    so while your clicki g and dragging its counting up and the faster you click and throw it, the lower the number would be. and if your holding and moving it slow, the larger that number would be

    You can then determin that so if bet result is < 1 big bet if bet result is < 1 but less then 1.5 middle bet and so on

    Havent actual tested it but that might work for you?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    OK

    I just looked at FMG's "throwing flicking demo" (search in the new section of the gs start screen)

    He has a change velocity rule in there that has a formula for the speed value. I think you could basically take the Y axis stuff out of the ball actor and use the formula found in the speed of velocity behavior. just put that formula into a change attribute behavior that is associated with your score system.
  • sebmacflysebmacfly Member Posts: 1,018
    Ok thank you guys! I'll take a look ;)
Sign In or Register to comment.