I’m trying to make my enemy wander around within a certain range. I wanna achieve this using PathFinding. I’m currently using MoveTo but he just runs in place (MoveTo is terrible on terrain) but his run animation doesnt work, he just instead runs in place.
Can you achieve this using PathFinding without have to place target points in the game?
I would create an origin point and a ‘wander’ radius. Then get a random point within that radius. Example pseudo code:
local origin = Vector3.new(5, 10, 5)
local wanderRadius = 20
local targetX = math.random(-wanderRadius, wanderRadius)
local targetY = math.random(-wanderRadius, wanderRadius)
local targetPoint = Vector3.new(targetX, targetY, 0)
pathfinding.findPath(targetPoint) -- Not an actual thing, just pseudo code