x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Particle System's SetStartPoint doesn't stay relative to actor

I have a particle system defined through the normal visual interface. I'm loading it inside of an actor, attaching it, and trying to get the start and end points to stay relative within the actor's coordinates, but no matter what I do they stay in world coordinates.

 UParticleSystemComponent *beam = NewObject<UParticleSystemComponent>(this, FName(*(name)));
 beam->AttachToComponent(RootComponent, FAttachmentTransformRules(EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, true));
 beam->RegisterComponent();

 // Loaded in the actor's constructor
 beam->SetTemplate(particleBeamComponent);

 // The beam is correctly transformed along with the actor when these are set!
 //beam->SetActorParameter("BeamSource", this);
 //beam->SetActorParameter("BeamTarget", this);

 // ... but not these
 beam->SetBeamSourcePoint(0, FVector(100, 0, 0), 0);
 beam->SetBeamEndPoint(0, FVector(0, 0, 0));


I have my source and target set to User Defined, but I've also tried all the other combinations. Not only does the beam not translate its source and target correctly, it doesn't transform along with the actor (it does appear in the view.)

When I set source and target to be "Actor" instead of "User Defined" the point correctly tracks the actor. I've resorted to updating source and target points for each beam in the actor's Tick method, but that seems sloppy.

Can I attach both ends of the beam to either points in space, components within the actor, or some other relative object such that the beam gets all the transforms from its parent? The mesh for the actor is entirely programmatic, so a c++ solution is ideal :D

Product Version: UE 4.13
Tags:
more ▼

asked Oct 27 '16 at 01:30 AM in C++ Programming

avatar image

Damouse007
6 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question