Hi Everyone,
I just got AC 4 days ago and is now learning from the 3D game tutorial.
I want to use Direct control in my 3rd person player game, and wish to let the character jumps. In the player Physics settings, the Ground-check is "Default".
The player can jump without problem, but it can keep jumping in the air, as well as changing directions, and not keeping the inertia in the air.
I tried changing the Ground-check to any layer, as well as the Collision Cube it is standing on to any layers, but it doesn't help except when the Ground-check is set to "Nothing" then it cannot jump at all.
I wish to make the player able to jump, walk, and change direction only on the ground, and keeps it horizontal travelling direction when in the air. What is the correct way to achieve this?
Thank you for your help.
Comments
Have you updated to the latest release, v1.61.0? There was an issue related to jumping that has been fixed, so if you haven't yet upgraded please try the latest to see if it's now resolved for you.
If it's persisting for you in the latest release, please post an image of your Player's full Inspector so that we can diagnose the problem.
The yellow sphere has no bearing on the ground check - it's there to indicate the distance from target destinations are considered "close enough". If you increase the "Destination accuracy" slider in the Settings Manager (under Movement settings), you'll find it gets smaller.
The Capsule Collider is what's used for ground checks, but it's necessary that the root position of the character is where the collider's bottom is. We could confirm in a screenshot of the Scene window, but going by your Inspector shot it looks like the collider's Centre is in the centre, whereas it should have a "Y" value of 1.2 if the Height is correct.
The 3D Demo's player character, Tin Pot, can be compared with for reference. He can be found in /AdventureCreator/Demo/Resources.
The prevention of movement while mid-air is a good suggestion - but one probably best left to custom script since that way you could introduce e.g. slower turning while jumping etc. I've written such a script and added it to the wiki:
http://adventure-creator.wikia.com/wiki/Lock_move_direction_while_jumping?venotify=created
This works by remapping the InputGetAxisDelegate to give control over AC's reading of the Horizontal and Vertical axes, so that it can return the "last grounded" values while in mid-air. For more on using delegates to overidde AC's input system, see the "Remapping inputs" chapter of the Manual.