Announcement

Collapse
No announcement yet.

Move a character NPC through waypoints with add movement input

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

    Move a character NPC through waypoints with add movement input

    First of all I have a spawner actor which spawns my character NPC. The spawner also has an array of way points which I place in the world in a 3x3 square. When the NPC is spawned I generate an array of vectors to represent a bezier path through the waypoints. Up until now everything works great.
    Click image for larger version

Name:	Capture.JPG
Views:	194
Size:	63.5 KB
ID:	1633963


    Now the problem is moving through those generated vectors. I started by simply using the
    Code:
    MoveTo
    task in the behavior tree this works however, the movement is choppy because the character stops at each point then proceeds to the next. So I have now been trying to implement a different method for doing this by using
    Code:
    add movement input
    like this:
    Click image for larger version

Name:	Capture.JPG
Views:	168
Size:	129.1 KB
ID:	1633964


    Code:
    splineDelta
    is the length of the full bezier curve divided by character speed divided by the number of spline vectors which works out to be the total time required to traverse between points.

    Now I'm obviously missing how
    Code:
    add movement input
    functions i assumed that it needs continues updating based on tutorials I've seen on implementing it to deal with with character axis controls. So that's how I've implemented it here in the character NPC blueprint.

    I've also tried only firing it when i need a new direction ie increment the index.

    In both these methods i just get the character twitching at the origin.

    Any help with this will be greatly appreciated.

Working...
X