Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: naktim0819 on March 07, 2013, 02:01:51 AM
-
Is there a way to take objects speed it?
I need a force keep add on a object
Because he might hit something to slow down his speed
So that force must be sustained there has been.
But at last It will to fast I need to catch
this object is to promote the speed to limit.
How do I find the speed value of the object is physically coupled it?
Thanks u! :D
-
hey,
can you paraphrase (write the phrase with different words) this?
How I caught this object has been to promote speed?
Do you want to find out the speed of a moving rigidbody?
-
oh sorry!!!!
When this object is "add force" after he was not generated a speed.
Per second speed increase up but he hit things will slow down because the physical
I want to catch this value to limit his most high-speed.
Maybe what you say!
I just do not understand that the value of I should be how to catch
Or what kind of things he is
-
ok, you can try this:
[STATE1]
"GetPosition" of your gameObject as Vector3 "First".
"Add Force" ... (every frame).
"sendEvent" delay : 0.1 seconds. Go to State2.
[STATE2]
In the next state again:
"GetPosition" of your gameObject as Vector3 "Second".
"Vector3 Operator" => "Second" - "First" = "SpeedVector"
"Get Vector3 Length" => "SpeedVector" to "Speed"
"float multiply" => "Speed" * 10 .
"SendEvent" go to STATE1 .
This gives you the speed of your gameObject.
You can do "Float Compare" in STATE2 with "Speed" . If Speed is high you can go to STATE3 :
[STATE3]
"wait" 0.1 . Go to STATE1 .
State3 = no "add force" for 0.1 sec. => gameObject is slower.
Does this help? What is your native language? Maybe I speak it.
-
Thank you! Success! Thank you for providing me a thinking mode!
I originally thought that the speed should be a value can be achieved!
But I learned a new way of thinking Thank you! I learn a lot!
Thx kiriri!!!!!!!!!!!!!
-
Ah great. The FSM works with any gameObject (rigidbody or not).
Something shorter (works only with rigidbody) :
"Get Velocity" + "Get Vector3 Length" . Both every frame.
Maybe this is easier ;)