Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: SStru1987 on January 21, 2014, 11:35:39 AM

Title: difficulty with character control
Post by: SStru1987 on January 21, 2014, 11:35:39 AM
I'm creating a game (2.5D) where the character falls and I'm trying to guide him past obstacles (he will be moving along only on the horizontal axis). I tried following the showcase page on Add Force and I'm not having any luck. Is there a suggested way of a FSM I should setup? Sincerely would appreciate it
Title: Re: difficulty with character control
Post by: Lane on January 21, 2014, 11:56:50 AM
What isn't working with add force? Can you post an example of what you're having trouble with?
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 12:03:36 PM
If you reference the showcase page for AddForce, It will be easier to follow along. I set it up the same way

What I want to happen is control my character using J= Slide Right & F = Slide Left. I've decided on this because I want to recreate the feeling of playing at an arcade machine.
 
What transitions, events and variables should I use to control my character as he slides left or right along the X axis? The overall mechanic is falling through level on a 2.5 view to dodge obstacles and enemies.

I appreciate your feedback and help

Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 12:06:46 PM
To better explain, I'm trying to add move left and right only without jumping or running.

when he falls I want to recreate how you direct this characters fall

http://jnamobile.com/samples/2DPlatformController/HeroSample.html
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 12:08:50 PM
except he slides fast to right or left
Title: Re: difficulty with character control
Post by: Lane on January 21, 2014, 12:13:15 PM
If you just want to add some force when you push a button then you can do it in one state

Get Axis (store float as inputFloat) [every frame]
Add Force (on an axis use inputFloat) [every frame]

Adjust Get Axis multiplier as needed and adjust Add Force Force Type as needed.

No input results in a zero for Get Axis, which means no force is added.
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 12:20:14 PM
You said: If you just want to add some force when you push a button then you can do it in one state

Get Axis (store float as inputFloat) [every frame]
Add Force (on an axis use inputFloat) [every frame]

Adjust Get Axis multiplier as needed and adjust Add Force Force Type as needed.

No input results in a zero for Get Axis, which means no force is added.




Do I add this state on the Slide Right/LEft states? How should I implement what you said in PlayMaker?
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 02:19:57 PM
I'm still confused on how to implement what you said in PlayMaker for the character
Title: Re: difficulty with character control
Post by: Lane on January 21, 2014, 02:32:57 PM
You only need one state. You can get the axis and apply the force every frame in the same state.
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 03:31:04 PM
No luck so far. I really need help and pulling my hair out. could you outline the steps of what I need to do in Playmaker?
Title: Re: difficulty with character control
Post by: Lane on January 21, 2014, 03:55:03 PM
This is all it takes to push an object around. Adjust the Multiplier in Get Axis for more/less force.
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 04:10:49 PM
where it says 'store' on "Get axis" is that a variable? if so, whats the type?
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 04:13:46 PM
Its applied, now how can I steer him by sliding left or right, because when I run it he always goes right
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 04:16:19 PM
nvm, I got it!!! Thank you so much!
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 04:17:28 PM
Last question, how do you map it to other keys? (As previously stated J=Right and F=Left)
Title: Re: difficulty with character control
Post by: Lane on January 21, 2014, 04:18:05 PM
http://docs.unity3d.com/Documentation/Components/class-InputManager.html
Title: Re: difficulty with character control
Post by: SStru1987 on January 21, 2014, 04:30:21 PM
NVM about that either bc i just figured it out …. thank you so much for your help