Mouse cursor on First Person Controller

Announcements, support questions, and discussion for the Dialogue System.
ujuj04
Posts: 30
Joined: Sun May 21, 2023 7:34 pm

Mouse cursor on First Person Controller

Post 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!
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Mouse cursor on First Person Controller

Post 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.
ujuj04
Posts: 30
Joined: Sun May 21, 2023 7:34 pm

Re: Mouse cursor on First Person Controller

Post by ujuj04 »

Yep, it helped :)
Thanks a lot!
ujuj04
Posts: 30
Joined: Sun May 21, 2023 7:34 pm

Re: Mouse cursor on First Person Controller

Post 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!
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Mouse cursor on First Person Controller

Post 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.
ujuj04
Posts: 30
Joined: Sun May 21, 2023 7:34 pm

Re: Mouse cursor on First Person Controller

Post 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!
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Mouse cursor on First Person Controller

Post 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:

Image

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
proximityTriggerOnPlayer.png (212.32 KiB) Viewed 352 times
ujuj04
Posts: 30
Joined: Sun May 21, 2023 7:34 pm

Re: Mouse cursor on First Person Controller

Post 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).
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Mouse cursor on First Person Controller

Post 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.
ujuj04
Posts: 30
Joined: Sun May 21, 2023 7:34 pm

Re: Mouse cursor on First Person Controller

Post by ujuj04 »

But then wouldn't it be possible to access the conversation from very far just by looking at the npc?
Post Reply