Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

I have an error on a C# script @username

$
0
0
I the line "GetComponents().addforce (Vector2.right * power);" there is an error saying "Type 'UnityEngine.Riidbody2D[]' does not contain a definition for 'addforce'and no extension method ' addforce' of type 'unityEngine.Rigidbody2D[] could not be found. Are you missing an assembly refernce?" How do I fix it? @username using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { public int power = 500; public int jumpHeight = 100; public bool isFalling = false; // Use this for initialization void Start () { } // Update is called once per frame void Update () { GetComponents().addforce (Vector2.right * power); } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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