Vector3 startpoint = [NPCs head/eyes]Vector3 direction = [the direction vector between your player and the NPC]RaycastHit hit;
if (Physics.Raycast(startpoint , direction , out hit)){ if(hit.transform.name == "NameOfYourPlayer") { //you hi…
That is not a very easy question to answer. What you would do is have a script on every NPC that shoots rays directly at the player. The ray would shoot from the eyes of the NPC to a target on the player. For that you need to figure out the distance…
Well that is obviously turned off ;)
I figured out what is causing my problem. And that problem is.... me!
I didn't lay out the navMesh segments through the doorway. And since I checked the "pathfind" box in the 'character > move to poi…
Ah, I see! A warning would be a good idea yeah.
Although I am still a bit confused, as I only have 1 scene, and it was always loaded when I was making/running the cutscene. It has no trouble linking to the in-scene items (like the NPC speakers or co…
(Image)
Alright. This is the setup.
I have a trigger on the floor.That trigger's script checks if the player has a certain item in his inventory, and if so, runs an actionlist from an asset file.
In the screenshot you can see the last part of that…
I have been having this issue as well, causing me to delete 95% done actionlists a few times. Maybe try this to reproduce:
Make an action list with a few actions in it. Then, delete the first node (the one attached to START), then undo that. I have …
And is there a way to make an NPC pause for a moment when he reaches a node? I have an NPC follow a path set to 'random'. I want him to pauze for a second whenever he reaches one of the points, but cannot figure out how.
What I do now to dodge the problem, when the "reset level" button is pressed:
KickStarter.sceneChanger.ChangeScene ("", Application.loadedLevel, false); //reload the same levelKickStarter.runtimeInventory.Start(); //reset the pl…
Chris!
I am running into similar problems using this action. I keep my 2 players prefabs in an asset folder (declared in the manager, but not present in the scene). Player nr 1 is loaded by default and put in the game. All works fine.
When calling t…
Thanks as always for the swift reply!Your suggestion works! Am I also had an error in my own code. When I build up my own menu with inventory items, I only grab the runtimeinventory items once in Start(). No wonder the items that I remove from the i…