This kinda works but It's very floaty and sprite remains the same regardless of what direction is facing. I have a capsule character and a moving platform to the right of the character’s platform. By default, a character can stand on any entity that has collisions, and a TrackedTransform component. Vector3 move = transform.right * horizontalMove ĬharacterController.Move(speed * ltaTime * move + gravityMove * ltaTime) Īnimator.SetBool("isWalking", verticalMove != 0 || horizontalMove != 0) I am working on a simple platformer, but with a 3D visualization. In this tutorial, I will be showing how to add moving platform support for CharacterController in Unity 3D. Vector3 gravityMove = new Vector3(0, verticalSpeed, 0) If (characterController.isGrounded) verticalSpeed = 0 Įlse verticalSpeed -= gravity * ltaTime Check out a recording of a Unity live training session by Matthew Schell that shows the process of setting up a custom character controller. (In early development - this will be released as a free Unity C script once I have a stable version ready) Im developing a C script featuring a robust and 3D platformer character controller and other 3D platformer functionality for Unity. Public CharacterController characterController Ĭursor.lockState = CursorLockMode.Locked įloat horizontalMove = Input.GetAxis("Horizontal") įloat verticalMove = Input.GetAxis("Vertical") Public class TelekinesisFunction : CommandĬommand keyX = new TelekinesisFunction() Solutions I've tried so far involve using Physics2D, but this fails as the players goes trough the ground when standing on 3D objects, or I've seen the use of Character Controller but I can't quite understand this approach as I don't understand how to change the keys or flip the sprite. I'm making a 2D platformer with a 3D environment but a 2D player (using sprites). ![]() It has that sluggish, laggy feeling and after letting go of the controls the character slightly slides a bit. ![]() Controlling my character with the standard assets 3rd person controller is kinda horrible. I've looked everywhere and I can't find a good solution to this. been trying to get that feeling of tight controls for a 3D platformer down but its not really working out.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |