Post by chainsawpenguin on Feb 22, 2017 4:57:44 GMT
Good evening, team!
I'm trying to stop the player when he encounters an NPC with available dialogue options (right now I'm stopping him automatically, but I'd eventually like to stop him if he chooses to interact with the NPC...). Unfortunately, his momentum is carrying him sailing hilariously beyond the NPC, and then being stuck in the background, though, curiously, the player can JUMP back to where he's supposed to be, but cannot WALK (or RUN) back....
So I'm close, but I'm doing something dumb.
Take a look at the snippet below. Basically, I'd like the player to just come to a stop, and play his (or her) idle animation, while I pop up the dialogue and responses. Currently, I have a total of two responses, but I'd like to have up to four one day.
----
Also, and sort of unrelated, currently the player has to click on the button for choice 1 or choice 2. Ideally, I'd like the game to detect when he's using a controller, and instead of clicking on 1 or 2, he'd be prompted to press A or B...
Have any of you guys implemented anything like this?
----
Also, and finally, is anyone interested in the full code for the quest dialogue? It's clunky, and a work in progress, but if you're interested I'll throw it up here (as long as that's not breaking some kind of rule).
Okay, I'll shut up now!
~~ chainsawpenguin ~~
I'm trying to stop the player when he encounters an NPC with available dialogue options (right now I'm stopping him automatically, but I'd eventually like to stop him if he chooses to interact with the NPC...). Unfortunately, his momentum is carrying him sailing hilariously beyond the NPC, and then being stuck in the background, though, curiously, the player can JUMP back to where he's supposed to be, but cannot WALK (or RUN) back....
So I'm close, but I'm doing something dumb.
Take a look at the snippet below. Basically, I'd like the player to just come to a stop, and play his (or her) idle animation, while I pop up the dialogue and responses. Currently, I have a total of two responses, but I'd like to have up to four one day.
public void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player") && !hasAcceptedQuest && !hasCompletedQuest)
{
myPlayer = other.gameObject;
myCamera.GetComponent<v3rdPersonCamera>().enabled = false; //this is working!!
myPlayer.GetComponent<vThirdPersonController>().speed = 0.0F;
myPlayer.GetComponent<vThirdPersonController>().stopMove = true;
myPlayer.GetComponent<vThirdPersonController>().enabled = false;
<... a bunch of other working code that displays the dialogue and options>
}
----
Also, and sort of unrelated, currently the player has to click on the button for choice 1 or choice 2. Ideally, I'd like the game to detect when he's using a controller, and instead of clicking on 1 or 2, he'd be prompted to press A or B...
Have any of you guys implemented anything like this?
----
Also, and finally, is anyone interested in the full code for the quest dialogue? It's clunky, and a work in progress, but if you're interested I'll throw it up here (as long as that's not breaking some kind of rule).
Okay, I'll shut up now!
~~ chainsawpenguin ~~