Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Player Falling down error.

Discussion in 'Scripting' started by tomowale, Mar 1, 2015.

  1. tomowale

    tomowale

    Joined:
    Feb 14, 2015
    Posts:
    308
    Lol funny little error I found while testing the game. The capsule ( Player) falls down some time after the cube is gone past it. :D:D:D:D . If this is fixable please let me know.:D
    Here is the player script if it helps.
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. public class MovePlayerScript : MonoBehaviour {
    4.     public float movespeed = 3f;
    5.  
    6.     // Use this for initialization
    7.     void Start () {
    8.    
    9.     }
    10.    
    11.     // Update is called once per frame
    12.     void Update () {
    13.  
    14.     //moves left and right along x axis
    15.         transform.Translate(Vector3.right * Time.deltaTime * Input.GetAxis("Horizontal")*movespeed);
    16.     }
    17. }
     
  2. tomowale

    tomowale

    Joined:
    Feb 14, 2015
    Posts:
    308