Get the Linear velocity (Drag actor)
sebmacfly
Member Posts: 1,018
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.
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
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
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.
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 :
The actor moves when pressed and has inertia.
I don't understand what you're trying to make...
Thanks
I'm out of ideas about that.
thanks a lot!
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?
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.