Search Unity

Jumping,having problem with capsule collider

Discussion in 'Getting Started' started by pikachufan255, Feb 7, 2018.

  1. pikachufan255

    pikachufan255

    Joined:
    Apr 2, 2016
    Posts:
    5
    The Problem im having right now is,when i hit a Solid Wall while Pressing the Jump and Moving forward at the same time ,i go up the Solid Wall.
    What im looking for is a way so the Capsule Collider isnt inside the Solid Wall. Oh and i still want free movement while in air.(additional info : i have a Transform,Rigidbody With Freeze on Rotation XYZ,Gravity ON(Default 9.81),Capsule Collider). Oh and i also ive tried the Vector3.y = (0,0,0)...you get the point hopefully... Heres the Scrip incase you want to help me out. using UnityEngine; using System.Collection; public class ThirdPersone : MonoBehaviour { [SerializedField] float Speed = 10; [SerializedField] float Rotation = 10; [SerializedField] float Jump = 5; void FixedUpdate(){ float v = Input.GetAxis ("Vertical") * Speed; float h = Input.GetAxis ("Horizontal") * Jump; v *= Time.deltaTime; h *= Time.deltaTime; j *= Time.deltaTime; transform.Translate(0, 0, v); transform.Rotate(0, h, 0); transform.Translate(0, j, 0); } } //write all this on phone so if any //mispell plz Fix,oh and i get no //errors with this on unity 5.4.0f3