playMaker

Author Topic: [SOLVED] How to add controls to character that is constantly falling down?  (Read 1926 times)

Vertical

  • Playmaker Newbie
  • *
  • Posts: 2
Hey. I've tried with ''Controller simple move'' Action setup with the camera attached, but just as i fall from the testing platform i cannot control my character.

I'm tinkering with ''Add Force'' Action and ''Axis.." Actions, but still haven't got any movement.

Basically in my vision of game, my character will be falling down from the very first frame the gameplay starts.
« Last Edit: April 28, 2020, 08:19:10 AM by Vertical »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
hi.
have a rigidbody(2d) on the object and use Axis + set Velocity

Vertical

  • Playmaker Newbie
  • *
  • Posts: 2
Okay it's solved. I've also got answers from your Discord server, so i really appreciate both of the answers, especially since they offered two different solutions.

For those visiting this post through browser search or some other way, here's the second solution.
It involves character not falling down and actually making objects come to you, so it seems like our character ''falls'' down.

Steps for the object that you want to control:
- add FSM to it
- in State 1 add Action called ''Get Axis Vector"
- change only ''Multiplier'' option to suit your character's movement speed
- in ''Store Vector'' option create a name for Vector3 variable (like Character_Movement or something like that)
- this Action is done, now create another Action called ''Controller Move''
- in ''Move Vector'' option set it to previously created Vector3 - the Character_Movement
- in ''Inspector'' window of Unity add ''Rigidbody'' Component. Have both boxes for ''Gravity'' and ''Is Kinematic'' options checked.
- go to Contraints options and have all boxes for ''Freeze Rotation'' checked.
- in ''Hierarchy'' window of Unity drag Camera object and assign it under object you want to control (there will be arrow appearing to the left if made correctly).
- finally set Camera object for example inside of controled object for first person view. Now camera will follow the controlled object.