edited July 2015 in Makinom Support
Hey GiL, great tutorial. It's my first time trying to create any kind of player controller, so I'm still trying to wrap my head around all of this. You didn't went through on how to add the walk animation and jump animations, so I took a few hours to tried it. The jump animation I succeeded, but no luck on the walking animation, so I'm all out of ideas on where to add it. If it were you, where would you add the play animation(walk) node?
Post edited by Shadow_Fire on
  • You could e.g. use a Check Speed node to check the machine object's speed and play the walk/run or idle animation depending on that. Add that after the Move nodes, or set up another schematic and tick machine handling movement animations to separate them from the controls - that way the movement animations would also kick in if the player controls are blocked (e.g. using game state conditions) and the player is moved through other machines.

    Or, when using a speed parameter in your animator, you could use the speed as Mecanim parameter (first using Store Speed to store the object's speed into a variable).
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited July 2015
    Thanks GiL! I got it.
    Another problem relating to the controller. I asked yesterday how to use the Global Machine. This time instead of a dialogue, everytime I press the O button, a bool variable canControl will be false or true based on their previous option.
    In the controller, I added a check variable node to check the bool and if it's false, the player can move around and if it's true, the player won't be able to move anymore. I spawned the player through ORK. The problem is that when the player can't move anymore, he'll just dropped very fast straight down through the ground to the empty blue void. But if I press the O button again, the player will automatically teleport back to the ground and can move around again.
    No matter where I check, I can't find out why. In the player rigidbody, gravity is enabled and kinematic is diasabled, with the freeze rotation/position of xyz all disabled.
    Post edited by Shadow_Fire on
  • What component are you using to move the player (and what else is attached to it)?
    E.g. if you only have a rigidbody without a collider, there is nothing stopping him from falling.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited July 2015
    I'm using the character controller along with the rigidbody. The things also attached to it are Object Variable Component to set the character ID as player, Tick Machine Component to add the player controller schematic, and Auto Machine Component to use the Schematic setPlayer as per the tutorial.
    Post edited by Shadow_Fire on
  • edited July 2015
    If you're using a character controller, try using a zero move (i.e. a Move node that doesn't move, having X/Y/Z=0) in case the controls are blocked. Character controllers should receive a move command each frame, for stuff like registering on ground and collisions.
    Post edited by gamingislove on
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks GiL. I got it.
    Right now when you jump, it goes straight up and come straight down instantly. How would you do it so that as it goes up, it'll slow down for a bit before coming back down? I tried tweaking the gravity, adding a addforce, and did all kind of stuffs, but to no success.
  • Hm, you could probably do that by fading the used gravity (i.e. using a variable as gravity).
    E.g. use a Float Smooth Step node to fade it to a target.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited July 2015
    Hmm, could you explain it more in details? :)
    After tweaking around for a few days, I still couldn't do it. Like where should the float smooth step go and how to use it as a variable in the gravity.
    Post edited by Shadow_Fire on
  • edited July 2015
    just add extra air time an you will get a smoother jump meaning while in air speed up a little bit so you move further. usually when dealing with a jump you have 3 forces that are in play one is how fast your originally moving then the vertical jump an then the in airtime which usually consist of speeding the player up a bit to move in a horizontal direction..... to answer your question the smooth step should go after your in the air so once your at the peak of your jump best to use a wait for this.. so you get the effect right at the peak of the jump an not before it
    Post edited by wtyson on
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
Sign In or Register to comment.