Page 1 of 1
Face NPC During Dialogue
Posted: Wed Dec 12, 2018 9:58 pm
by pegassy
I am using UCC integration and working on a 2.5D game. My NPCs are mostly on the background, just one or two meters behind the Z axis. I would like my player character to face them while talking. Is there a way to do this simply by using the DSU integration? I know that the converse ability has features for disabling the controller and such, I was wondering if making the player character face the NPC is also possible.
Thank you.
Re: Face NPC During Dialogue
Posted: Wed Dec 12, 2018 11:11 pm
by Tony Li
UCC keeps a tight grip on the character's position & rotation, which is a good thing when it's controlling custom gravity, but inconvenient for dialogue. This would be a good option to add. I'll contact the developer to work up a solution.
In the meantime, you can use the SetEnabled() sequencer command. I'll assume the first dialogue entry node is spoken by the NPC. Set its Sequence to something like:
Code: Select all
SetEnabled(UltimateCharacterLocomotion, false, listener);
LookAt(speaker, listener);
SetEnabled(UltimateCharacterLocomotion, true, listener)
This will disable UCC, rotate the listener to look at the speaker, and then re-enable UCC.
Re: Face NPC During Dialogue
Posted: Thu Dec 13, 2018 4:27 pm
by Tony Li
Here's an updated integration package:
OpsiveUCC_DialogueSystemIntegration_2018-12-13.unitypackage
It adds a sequencer command
uccLookAt(target, subject, [duration], [allAxes]
). It works for all subjects, UCC-controlled or not. If the subject is omitted, it defaults to the speaker. Example:
The command above immediately rotates the speaker to look at the listener.
Typically the player is the listener of the first node, and the NPC is the speaker. To make the player look at the listener in this case:
Re: Face NPC During Dialogue
Posted: Sat Dec 15, 2018 2:55 am
by pegassy
This is wonderful Tony. Thank you for going out of your way to get an integration on this so quickly. I am very excited to try this tomorrow.
Re: Face NPC During Dialogue
Posted: Sat Dec 15, 2018 8:18 am
by Tony Li
Glad to help! Opsive has already put this package (actually a slightly updated one with minor changes) on their site, too.