error CS1525: Unexpected symbol `)', expecting `('
I am trying to ignore colliders in my scene . I did the by number layers and I gotten an error . The player has a collider and so do the enemy ai's . The enemy ai's on the default layer . I am trying to avoid the default layers . When the player collide in the enemy ai the player leg flop up and down and the enemy is the stuck on the player . Anywhere the player moves the enemy ai stays on the player.
Here is my script :
using UnityEngine;
using System.Collections;
public class laying : MonoBehaviour {
// Use this for initialization
void start () {
Physics.IgnoreLayerCollision(default);
}
// Update is called once per frame
void Update () {
}
}
Answer by Arkaid · Aug 17, 2016 at 03:11 AM
Physics.IgnoreLayerCollision(default);
is wrong. Try:
Physics.IgnoreLayerCollision(LayerMask.NameToLayer("Default"));
I got this error :
error CS1501: No overload for method IgnoreLayerCollision' takes
1' arguments
Right, sorry. You need two layers
You need two tell it which two layers don't collide with eachother. For instance. If you don't want Default layer to collide with another Default layer, then it will look like this:
Physics.IgnoreLayerCollision(Layer$$anonymous$$ask.NameToLayer("Default"), Layer$$anonymous$$ask.NameToLayer("Default"));
The error went away script is attach to the player . Should I remove the script component and attach it to the enemy ai ? The player leg still flop up and down when the enemy ai is near .
Your answer
Follow this Question
Related Questions
error CS1525: Unexpected symbol `offsetX' 1 Answer
Unexpected symbol 'float' 1 Answer
Error CS1525: Unexpected symbol 'void' 1 Answer
Unexpected symbol 1 Answer
Unexpected Symbol ' var' 1 Answer