Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Particle effect component, giving it a remote location.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Particle effect component, giving it a remote location.

    I'm trying to enable a particle effectt and make it play at a specific location.

    But I just can't get it right. Simply playing it and updating it's location to the wanted location sends the particle effect all over the map.
    I was thinking it may be using the location of the object it's a part of, and that I needed to subtract that location.

    But it's still way off:

    (If the video is not available, it may still be uploading. Give it a moment)

    As you can see there's also other issues, it interpolates really quickly while moving, and it's upside down. You can also see it moves down when it should move up, and vice versa.

    Here's the relevant code;
    My PlayerController:
    Code:
               SMRightWeaponAttachment_Laser(RightWeaponInstance).UpdateHitGlow(TempTarget-Pawn.Location);
    TempTarget is my wanted location.

    The object holding the component:
    Code:
    simulated function UpdateHitGlow(vector HitLocation)
    {                                                        
       PSC_HitGlow.SetTranslation(HitLocation);
    }

  • #2
    1. Probably because you passing Direction as HitLocation to SetTranslation.
    2. Why you using SetTranslation instead of SetLocation..?
    3. Why not spawn each time different explosion..?

    Comment


    • #3
      Originally posted by VendorX View Post
      1. Probably because you passing Direction as HitLocation to SetTranslation.
      I'm not. TempTarget is a vector in world space.

      Edit: Wait, is a HitLocation of a Trace a world space vector or is it a distance along a direction?
      Originally posted by VendorX View Post
      2. Why you using SetTranslation instead of SetLocation..?
      That's what components use. SetLocation does not exist in a component.

      Originally posted by VendorX View Post
      3. Why not spawn each time different explosion..?
      Because that's not how I want it to behave.

      But what do you mean "Spawn an Explosion"? Do you mean to make a unique actor for the explosion?
      But no, spawning a new explosion each tick really isn't appropriate.

      Comment


      • #4
        I've had a similar issue with DrawSphereComponents, they weren't moving because they didn't need to for my needs, but they were waaaay out of position.
        I have also tried passing it the worldlocation directly and also in local coordinates relative to the components owner. None of it worked...

        p.s. HitLocation should indeed be in worldspace.

        Maybe try something like vect(0,0,0) to see where the particle is and if it follows correctly.

        Comment


        • #5
          Cheers, figured out the main part of the issue was the socket the object was attached to being upside down.
          I've fixed that, and istead of removing the pawn location, I now remove the socket location.

          It's much better now, but it's still off (the movement and rotation is about twice of what it should be).

          Here's how it currently behaves:


          It's also still interpolating very quickly every time I update the translation. At first I thought it could be because I activate the Particle system each time the trace hit, maybe it was resetting each time. But I added a precaution so it only activated once. But it still behaves like that.

          Comment


          • #6
            Duh, I feel like a moron now. Of course it doesn't work, I'm giving a local vector a world space vector.

            I tried to fix it like this:
            Code:
            (TempTarget << R_AttachmentRot)-R_AttachmentLoc)
            TempTarget is where I want my component to appear in world space. R_AttachementRot is the rotation of the component's local space while R_AttachmentLoc is its local vector.
            But it's still not quite right, it's especially off if the pawn moves.
            What did I do wrong?

            I got the local rotation and location by doing a GetSocketWorldLocationAndRotation, but I realize now that they also may be relative to world space rather than local, particularily the vector. How do I definitely get the local rotation and vector if that is the case?

            I also found out why it was interpolating so quickly. In an unrelated bit of code, I was still activating it each tick, and I didn't find it until now. I think it was left over from some debugging long ago.

            It's also stuttering quite a bit, but I think that's just the particles needing to accomodate movement better (Spawning too rarely).

            Comment


            • #7
              Anyone got any ideas? I believe conversions between local and world vectors are quite common.

              Comment

              Working...
              X