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);
}
}
↧