Playmaker Forum

PlayMaker News => General Discussion => Topic started by: Nitrohex on January 17, 2014, 05:00:23 AM

Title: Virtual Joystick use force instead of transform position?
Post by: Nitrohex on January 17, 2014, 05:00:23 AM
I'm having this long mind exercise to try to figure out how to make the virtual joystick work so instead of transform position i need to use force to move my object.

Any advice or idea on how can this be acheved?

Thanks
Title: Re: Virtual Joystick use force instead of transform position?
Post by: Lane on January 17, 2014, 09:09:34 AM
 What do you mean by virtual joystick?
Title: Re: Virtual Joystick use force instead of transform position?
Post by: Nitrohex on January 17, 2014, 07:56:28 PM
What do you mean by virtual joystick?

The Virtual Joystick controls like this https://www.assetstore.unity3d.com/#/content/3322
Title: Re: Virtual Joystick use force instead of transform position?
Post by: Lane on January 17, 2014, 08:43:54 PM
Ahh ok, I dunno about that one it just depends on what kind of information you get from the Joystick script. You'll need to use whatever inputs its giving back and put that into a control system that uses physics.
Title: Re: Virtual Joystick use force instead of transform position?
Post by: Nitrohex on January 17, 2014, 09:17:52 PM
I can take the input from the Joystick for example to have it move another object via transform, and store speed or velocity in a variable, but the
put that into a control system that uses physics.
is the part that keeps me up at night :D :D :D

Title: Re: Virtual Joystick use force instead of transform position?
Post by: Lane on January 17, 2014, 09:29:50 PM
Is it returning vectors or floats? Add Force accepts both, so if its a vector its pretty simple, run the input results through a multiplier and feed them into add force. Probably want to use a separate FSM to handle orientation of the character though.
Title: Re: Virtual Joystick use force instead of transform position?
Post by: Nitrohex on January 17, 2014, 09:54:44 PM
I will try different methods throughout this weekend, and i will update the post on my progress.

As always, thank you on your advices Lane, i appreciate it.
Title: Re: Virtual Joystick use force instead of transform position?
Post by: Nitrohex on January 29, 2014, 09:35:55 AM
A bit late than promised but,i did a lot of testing and trying out different solutions and at the end i made a combination between leaving the object to be a rigid body and moving it by transforming its position and simulating physics by easing the movement in and out.
Behavior is similar as adding force, so its good enough :)