C++ Particle System - Set initial velocity / rotation

I am trying to create an effect where when a player jumps I shoot particles out the bottom of the characters foot.



UParticleSystemComponent* MultiJumpParticleSystem;

Character.cpp: (constructor)

MultiJumpParticleSystem = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("MultiJumpParticleSystem"));
	MultiJumpParticleSystem->bAutoActivate = true;
	MultiJumpParticleSystem->SetRelativeScale3D(FVector(0.2f, 0.2f, 0.2f));	
	//MultiJumpParticleSystem->SetWorldRotation(FRotator(0, 90, 90));
	MultiJumpParticleSystem->AttachTo(GetMesh(), FName("foot_r"), EAttachLocation::KeepRelativeOffset);
	static ConstructorHelpers::FObjectFinder<UParticleSystem> ParticleAsset(TEXT("/Game/Sample_sharedassets/Models/Thrust.Thrust"));
	if (ParticleAsset.Succeeded())


The particle system always shoots the particles down the Y axis. I would like for the particles to shoot straight down. When I blueprinted this out I was able to change this by going into Cascade and changing Start Velocity to go down the Z access. I cant figure out how to do this in code though.

Have you tried setting your emitter to use local rotation? (available on the emitter section in Cascade).

Ideally you should be able to design you emitter exactly how you want in Cascade itself without having to set any additional rotation through C++ or elsewhere.

BTW have you considered using anim notifies on your jump animation? They sound ideal for your situation - check out this video from Epic.

Hope this helps.

For anyone that needs pictures and instructions (version 4.10.x):

  1. Double click you particle blueprint in the content browser.
  2. Double click on the field that says Required (yellow) under the orange Particle emitter box
  3. In the details panel there is an emitter rotator field you can modify.