PlayMaker Help & Tips > iOS Help

On screen joystick acceleration?[SOLVED]

(1/1)

cb:
Hi,
I've been using the mobilejoystickcontrols package as created by Jean and have them working well. I need to convert them a little and fix them to work on an Asteroids-type ship, with inertia. So Left button to rotate ship, Right button to Thrust.
What's the best approach to do this; I want the Right button to slowly add thrust to my ship as it is held down, but to fall away slowly to zero when it is not held down.
Anyone have such a control system ?

jeanfabre:
HI,

 the key is to not alter what I did, but actually add another layer of processing that fits inbetween the ship you want to control and the joystick controller.

 to be clear, you accept the input as is, but you will add some "inertia" to it before forwarding that input to the ship controller.

using float interpolate action, your target would be the joystick input and you would interpolate your current ship control float to always catch up with the input. Does that make sense?

Bye,

 Jean

cb:
Yes that does make sense in theory, the odd thing is that I can do this in Unity scripting but still getting to grips with the best way to do this in Playmaker! Kind of the wrong way round, but i'm still adjusting from writing code to this visual approach.

Yes, Interpolate is exactly what I need...I'd love to see a full game creation tutorial that covers this stuff though, just a very basic shooter taking you from the title screen to movement/shooting and to game over. Unlike actual coding I'm finding that it's not the commands that are tricky but the actual layout and sequence of States and how they connect together, but I'm getting there.

jeanfabre:
Hi,

 Had a go at this, and the action Float interpolation is not good for the task, what you need is actually set your ship to be a Rigidbody and add force to it to really get the best possible reaction.

 Are you acquainted with rigidbodies set up and add force action?

bye,

 Jean

cb:
Hi,

Yes, I realised that Rigidbodies are the way to go. I've come up with something similar to what I wanted, thanks for the help.

Navigation

[0] Message Index

Go to full version