### Trigger + setActive

There are no stupid questions, just stupid answers.

#### Trigger + setActive

criskegler
Posts: 2
Joined: Sun Aug 20, 2017 7:51 am
It's my first day with T3D and i'm tryng to make a command to set a "flare"(PArticleEmitterNode) active using the trigger notepad.

I have been reading the manual for hours and i cant figure out how to use "void ParticleEmitterNode::setActive(bool active)".

#### Re: Trigger + setActive

Duion
Posts: 813
Joined: Sun Feb 08, 2015 1:51 am

I would just create the particle on trigger and then delete it again.

Here is some example code I once usede to create blood spatter effect on player hit:

Code: Select all

   %particles = new ParticleEmitterNode()     {      position = %position;        rotation = "1 0 0 0";        scale = "1 1 1";        dataBlock = "SmokeEmitterNode";        emitter = "bloodBulletDirtSprayEmitter";        velocity = "1";     };     MissionCleanup.add(%particles);     %particles.schedule(1000, "delete");

It is created on player damage, but you can just move it into your trigger function and then it is deleted after 1 second, works fine. You may have to add location data where you want it to appear, since in my case the location is automatically set to where it hits the player. Of course you need to set the dataBlock and emitter to use your existint particle datablocks.

#### Re: Trigger + setActive

criskegler
Posts: 2
Joined: Sun Aug 20, 2017 7:51 am
Duion

Thanks for the help!!

#### Who is online

Users browsing this forum: No registered users and 1 guest