Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: bartas on August 12, 2015, 07:38:02 PM

Title: Move Towards and setting speed
Post by: bartas on August 12, 2015, 07:38:02 PM
Hello Guys!
In my game we're moving a car by a left clicking the map, then it's moving there "TARGET" object , storing position and sending to another fsm where car should move towards. Everything works fine untill I didn't decided to make a Slower object. I don't know how to slow his speed. I tried to multiply that target vector3 by 0.5 etc, but it dosen't work as it should and sometimes the slower was pushing my player away insted of slowing. I tried also iTween , but an hour later I found out it's not the best for my game. I've also made new fsm that is getting speed of my car every frame,but actually I have no idea where I should use that variable. So here's my question , how to set speed of my car when it will collide with a slower?

I hope you will understand me , and sorry for my english skills since english is not my native languge.
Thank you!
Title: Re: Move Towards and setting speed
Post by: flora on August 14, 2015, 07:36:02 AM

hello  :)

if i understood well, i think the Move Towards action is gonna make your life very complicated .. because the Max Speed setting in the action will override any physics you have going on, causing weird behaviours like the one you described. Eventually you could try to use a variable for the Max Speed setting and change it when you need to ...
But may be, it would be simpler to use another way, like :
-put a rigidbody on the car
-use Look At action to locate the target/destination
-use Set Velocity action to go there (put collider/trigger at target/destination to determine when you arrive there)
-use Set Velocity again anytime you want to change speed

Title: Re: Move Towards and setting speed
Post by: bartas on August 20, 2015, 05:24:54 PM
Thank you for your advice. As soon as I'll find time I'll try it.
Title: Re: Move Towards and setting speed
Post by: flora on August 21, 2015, 01:02:52 PM

thanks for your answer :)

don't forget to put some rigidbody on the other cars too .. like this most of the collisions will take care of themselves thru physics