Announcement

Collapse
No announcement yet.

Projectile Movement - Need it to move through the given Vector points.. HELP!

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

    Projectile Movement - Need it to move through the given Vector points.. HELP!

    Hello,
    So I have a projectile that is spawned after I have created an array of Vector points. The projectile should begin its journey at the player character and move to each of the given Vector points. I'm at work so I don't have the exact Blueprint..

    Basically I've tried using "Interp to Movement" and passing each of the Vectors to that after I create the projectile in the form of "Control Points" but can't make this work after about 5 hours of messing with it. The projectile spawns at the player character then immediately teleports to the center of the map where it stays forever. I'm guessing this has something to do with Velocity? I don't even know at this point and I'm exhausted with searching forums for a solution to this problem.

    I just need the projectile to spawn at the player character, then actually move(not set location) to the given Vectors one by one. I thought about using a homing device and destroying/creating the next one upon reaching one but that seems necessarily difficult. If I could create a path for the Projectile to follow that'd work to. I think what's really driving me crazy is that I'm using Vectors to map a bunch of locations and trying to pass those to some form of movement is not working due to movement being based on Velocity..

    Any help would be great, thanks..

    #2
    If it jumps to the center of the map, that means it is getting a 0,0,0 location. That means that it's not getting the vectors you are feeding it.

    Use print strings and find where it fails.

    Comment


      #3
      I wish this was the issue, I have it set up to print out every Vector issued. I first have to make the Vectors, then store them in an Array. Then a ForEach to convert each individual Vector to the Control Point format(since it's not the same as a literal Vector). I have printed both before and after the conversion and the Vectors I'm getting match up with the ones I've given it. Unless there's some checkbox somewhere I'm missing that'll make this function, Control Points just don't work for me at all.

      Comment


        #4
        Messed with it a bit.. Now the projectile just sits in place..

        Comment


          #5
          So I placed my projectile on the map and fed it control points on EvenBeginPlay and that works.. But the projectile I spawn won't move..

          EDIT: It moves again, I was clearing the Control Point array which was effectively making is have no orders.. But now it's teleporting immediately back to the center of the map.
          Last edited by grotesqu; 09-21-2015, 11:40 PM.

          Comment


            #6
            Click image for larger version

Name:	ControlPoints.PNG
Views:	1
Size:	275.4 KB
ID:	1088012

            So at this point I've moved all of the 'logic' into the spawned actor. What's happening now is the actor is spawning at Player Character but then immediately moves to [0,0,0]

            Click image for larger version

Name:	PointsAndTrace.PNG
Views:	1
Size:	510.7 KB
ID:	1088013

            Here's a picture of the action, the print is literally the Control Points of the actor. The line on the right is the spawn(Player Character) and the line on the left is the center of the map([0,0,0]).

            No idea what else I can do.. So confused. Why does the actor that's placed on the map in the editor accept Control Points perfectly but the one I spawn always moves to the center of the map?

            Comment


              #7
              Was a solution to this problem ever found? I am experiencing the exact same situation. My actor keeps moving towards the center of the map. I have tried printing out all the vectors and everything is set as it would be expected but when the "interp to" component gets activated, my actor moves toward (0,0,0).

              Anyone have any ideas? I would really prefer to use this component instead of running everything through a tick or a timeline. Thanks!

              Comment


                #8
                I did some more digging and ended up using the "Move Component To" node instead. It provided exactly what I was looking for and was much easier to setup.

                Comment


                  #9
                  Just run into this. Note to anyone else, if you need to configure the motion at runtime then this component is broken and useless for blueprints. The cause of the resetting to origin is that the component updates its control points in its BeginPlay and won't ever do so again without being reset, which can't be done from blueprint.

                  Comment


                    #10
                    Fot InterpToMovement use FinaliseControlPoints after setting your ControlPoints array for this component.

                    Comment

                    Working...
                    X