Page 1 of 1

Spawn/display an object during a conversation

Posted: Thu Jul 28, 2022 2:23 pm
by hrohibil
Hello


During a conversation, when a player for instead gets handed something over from NPC, I want to trigger either image or particlefx. The camera is at default closeup, so i need to have whatever i spawn particles or or objects to be in front of camera.

More specifically when a word is being typed in the conversation I would like something to appear..

Re: Spawn/display an object during a conversation

Posted: Thu Jul 28, 2022 3:00 pm
by Tony Li
Hi,

You could set up a particle effect in front of the NPC and set its GameObject inactive. On the dialogue entry node where the NPCs gives the item to the player, use the SetActive() sequencer command to activate the GameObject. Example:

Code: Select all

{{default}}; SetActive(MyParticleFX)
It's complicated to make it appear at a certain word in the text. But it's easier to make it appear at a certain time -- for example, 1.5 seconds into the subtitle:

Code: Select all

{{default}}; SetActive(MyParticleFX)@1.5

Re: Spawn/display an object during a conversation

Posted: Thu Jul 28, 2022 3:28 pm
by hrohibil
Thanks Tony.

It works awesome...

SIDENOTE:

I have this camera view on my NPC conversations

Code: Select all

Camera(Closeup, speaker,1);
Its a bit to close as the NPC animation moves his head toward camera and then it clips the view. I would like it to go slightly bit back.. Is that possible with the closeup command?

Re: Spawn/display an object during a conversation

Posted: Thu Jul 28, 2022 4:13 pm
by Tony Li
If you only want to adjust it for this one NPC, add a uniquely-named GameObject as a child of the NPC, such as "Wizzard Camera Angle". Position and rotate it exactly where you want the camera to be. Then use its GameObject name:

Code: Select all

Camera(Wizzard Camera Angle, , 1)

Re: Spawn/display an object during a conversation

Posted: Thu Jul 28, 2022 4:58 pm
by hrohibil
Thank you that helped.

BTW When i using a static object in this code

Code: Select all

{{default}}; SetActive(MyParticleFX)@1.5
it works but when i use a particle fx it freezes due to i have checked of Pause game during conversation. And it does not have an animator i can set the unscale time to.

Aby suggestions?

Re: Spawn/display an object during a conversation

Posted: Thu Jul 28, 2022 5:02 pm
by Tony Li
Set the Particle System's Delta Time > Unscaled.

Re: Spawn/display an object during a conversation

Posted: Thu Jul 28, 2022 5:08 pm
by hrohibil
Wow did not see that one.
Thank you Tony 👍

Re: Spawn/display an object during a conversation

Posted: Thu Jul 28, 2022 7:29 pm
by Tony Li
Glad to help!