Well, i need some support on scripting.
I`ve got 2 objects. One is the Main Character and the other is a Sphere.
I need to use a trigger when the Main Character gets inside the Sphere.
I`ve attached a Character Controller on the Main Character and put a Mesh Colider on the Sphere, and checked the “is Trigger” box.
So on the Sphere there is a Script:
function OnTriggerEnter () {
Debug.Log("Hello");
}
Well, it works fine, but my problem is that its a Point and Click game, and when i click inside the Sphere the Character avoid it like there is a “Wall” there.
Is there a way to make the Sphere has no Physics or mass? So the Character could enter on it and trigger the script.
Thanks in advance.
I think you just need to check the “istrigger” box on the collider. That should do what you are asking.
I`ve done it. But my Character keeps avoiding the Sphere. Its just turn around it and do not enter because of the Mesh Collider. Even with “is Trigger” checked.
What i need is a way to force “is Trigger” without a collision, a way to make a object goes into a “invisible object” to trigger the animation.
No other colliders or subobjects in there? AFAIK isTrigger is supposed to do exactly that. Or are are there any other scripts controlling motion?
Strange though it seems, a collider configured as a trigger will still be detected by raycasts. If you are using raycasts for the point-and-click system (or character obstacle avoidance) then you will probably need to put the trigger on the Ignore Raycasts layer.