Скрипт:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Platform : MonoBehaviour
{
public float forceJump;
public void OnCollisionEnter2D(Collision2D collision)
{
if (collision.relativeVelocity.y < 0)
{
Doodle.instance.DoodleRigid.velocity = Vector2.up * forceJump;
}
}
}
Ошибка: NullReferenceException: Object reference not set to an instance of an object
Platform.OnCollisionEnter2D (UnityEngine.Collision2D collision) (at Assets/Scripts Game/Platform.cs:13)