Page 1 of 2
Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 7:45 pm
by ujuj04
Hey, I set up the main components and everything works fine, however I am using a 1st person controller and when I open activate the dialogue my cursor disappears. I saw in another topic that I should enable it on a On Conversation Start in the Dialogue System Event, but not sure ow to access the Show Cursor variable.
Thanks in advance!
Re: Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 8:05 pm
by Tony Li
Hi,
If you're starting the conversation using a Dialogue System Trigger, tick the Dialogue System Trigger's Actions > Start Conversation > Show Cursor During Conversation checkbox.
Re: Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 8:24 pm
by ujuj04
Yep, it helped
Thanks a lot!
Re: Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 8:27 pm
by ujuj04
One more quick question though! In an FPS can I make it so that the conversation is only possible when the player is looking towards the NPC? I figured out how to make it with a selector, but I'm using a proximity selector now. Thanks!
Re: Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 8:49 pm
by Tony Li
Hi,
Yes:
On the NPC, add a regular collider (e.g., a capsule collider roughly the size of the NPC's body).
On the player, add a regular collider, and add a trigger collider for the Proximity Selector. Position the trigger collider so extends forward from the player's body instead of going out equally in all directions (front, back, and sides) from the player.
Re: Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 9:16 pm
by ujuj04
Hey, I understand the solution, however it didn't work for me. I was experimenting and realized that the trigger player collider doesn't actually affect the interactivity with the NPC at all. Even if I completely disabled it, I could still interact with the NPC, so I guess something else is giving it the trigger, what could it be?
Sorry, I'm kinda new to the engine, so I might be making a dumb mistake here ahah. Thanks in advance!
Re: Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 9:23 pm
by Tony Li
Hi,
Does the NPC have a trigger collider by any chance? You don't want to set it up like the image in the
Proximity Selector section of the manual:
In the image above, the big trigger collider is on the NPC (the character with red accents). In your case, make sure the NPC only has a regular collider, and add the trigger collider to the player like below:
- proximityTriggerOnPlayer.png (212.32 KiB) Viewed 390 times
Re: Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 9:51 pm
by ujuj04
Thanks for the help, but I still can't get it. Even though my player capsule does have a collider trigger and the NPC doesn't (it only has a collider without a trigger) I can't interact with it. I think the thing is that for some reason it doesn't detect the trigger collider on the player. It does detect it if it goes the other way around (like in the top image you attached).
Re: Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 10:35 pm
by Tony Li
What about using a Selector instead? Since you're using the First Person Controller, you can pretty much just use the defaults. It targets the center of the screen, which is where the camera/player is looking. If it's not detecting the Usable NPC, you can tick the Selector's Debug checkbox. This will show raycast gizmos in the Scene view. There will be a line straight out from the camera. If it hits a Usable (e.g., NPC), it will draw a green wire sphere where it hit the Usable. If it hits something else, such as a wall or floor, it will draw a red wire sphere where it hit.
Re: Mouse cursor on First Person Controller
Posted: Sun May 21, 2023 10:40 pm
by ujuj04
But then wouldn't it be possible to access the conversation from very far just by looking at the npc?