- Home /
This question was
closed Aug 05, 2017 at 01:46 AM by
Awanonimik for the following reason:
Fixed the problem myself, detailed in comments.
Question by
Awanonimik · Aug 05, 2017 at 01:41 AM ·
scripting problemerrorerror messagebugs
Error "OnTriggerEnter: this message has to be of type: Collider"
When attempting to use an OnTriggerEnter script, I get this error:
Script error: OnTriggerEnter
This message parameter has to be of type: Collider
This message will be ignored
my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LevelTriggerScript : MonoBehaviour {
public float newLevelTarget;
void OnTriggerEnter(Collider2D other) {
Score.SharedInstance.levelTarget = newLevelTarget;
}
}
I kinda really need help with this.
Comment
Apologies, made a stupid mistake. I'm using a 2D object, and OnTriggerEnter for 3D objects.
Follow this Question
Related Questions
Was gameObject.GetChild(childsName); a thing? 2 Answers
Help with basic AI script 1 Answer
Array Out of Index (When it Really is not??) 1 Answer
Cant fetch components from GameObjects stored in an array? 0 Answers
How do I fix this problem-it won't let me start my game in Unity because of an override problem 1 Answer