Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a Beam ParticleSystem which looks like this:

Screenshot of ParticleSystem

I want to set the Target location when the effect plays, but I can't figure out how to do that from UnrealScript.

I've looked at the UDN page on it: link

But this doesn't seem to explain how to access the relevant info from script. I am currently able to get the effect to play, but I just can't set the endpoint.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Turned out to be quite simple:

function PlayTeleportBeamSystem(Actor SourceActor, ParticleSystem PSystem, Vector Target, optional Vector Source = Vect(0, 0, 0))
{
    local ParticleSystemComponent PSysComponent;

    PSysComponent = new(SourceActor) class'ParticleSystemComponent';
    PSysComponent.SetTemplate(PSystem);
    SourceActor.AttachComponent(PSysComponent);
    PSysComponent.ActivateSystem();
    if(!IsZero(Source))
    {
        PSysComponent.SetBeamSourcePoint(0, Source, 0);
        PSysComponent.SetBeamSourcePoint(1, Source, 1);
    }
    PSysComponent.SetBeamEndPoint(0, Target);
    PSysComponent.SetBeamEndPoint(1, Target);

    m_TargetedTeleportSystemComponentArray.AddItem(PSysComponent);
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.