Quantcast
Channel: Questions in topic: "left"
Viewing all articles
Browse latest Browse all 135

can't move player rigidbody.velocity

$
0
0
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Obstacle : MonoBehaviour { Rigidbody2D rb ; public float moveSpeed ; private void awake () { GetComponent () ; } private void fixedUpdate () { GetComponent ().velocity=( Vector2.left * moveSpeed); } void Update () { if (transform.position.x < -5f) Destroy(gameObject); } }

Viewing all articles
Browse latest Browse all 135

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>