- Home /
Question by
remeris · Apr 28, 2013 at 08:08 AM ·
collisioncharacter controllernewbienew
Basics of Collision help. Working with character controllers.
I have a bit of C++ experience, but this is my first attempt at anything Unity. Currently the plan was to make a small, 3d, adventure game, and i'm working on being able to interact with NPC's.
I have just two rectangles in the scene, Player character and NPC. PC is using the third person player controller, and I have a small invisible rectangle parented to him, being used as a trigger. My intention is to check for an NPC which is colliding within this trigger, and if there is, allow them to interact.
The NPC is just another square, using a character controller as well.
Comment
Answer by Vonni · Apr 28, 2013 at 02:13 PM
This script on the trigger:
function OnTriggerEnter (other : Collider) {
if(other.tag == "Player"){
//something...
}
}
This is very simple, but a start :)
And by "Rectangle" i guess you mean a cube.
Your answer
