Hey I’m trying to make a charging enemy that will just run in a straight line charge in a player’s direction and charge will carry the enemy past the player’s location a small distance. Right now I’m trying to use AI move to and some calculations for the position past the player, which isn’t working out so well. Could anyone please help me or give a better solution?
hey sorry to rez a dead thread here but did you figure out how to do this?
there’s a few ways this could be done. first as mentioned use one of the move to nodes which uses pathing to a target location (may not be straight line). other options include using a timeline, a vector lerp, and a set location node to set the characters location though this may not work well with animations. a VInterp would work as well.
for the move to solution: i would use a line/shape trace going from the character to the destination to see if there’s anything in the way and if so modify the destination to the hit object. then since its a charge change the max walk speed of the character to a sprint like value. then do the ai move to. and finally reset the walk speed value.
the timeline solution may be a bit simpler to script as its really just a move from a to b over time which requires fewer node, but it also has its downsides as well. you could still implement the trace if you wanted to check for obstacles. this method doesn’t work as well in my opinion for running animations but would work well with a aerial dash (anything where you don’t need to match the leg movement to the movement speed).
Alright I went the raytrace option that’s working pretty well thanks