News › Forums › RAIN › General Discussion and Troubleshooting › AI not moving towards waypoint (following 10 minute tutorial)
This topic contains 26 replies, has 9 voices, and was last updated by prime 2 years, 3 months ago.
December 18, 2022 at 6:32 pm #5965
Started with a more complex scene with the 10 minute tutorial that so far has taken over 2 hours, as I try to troubleshoot why the waypoints are not being followed.
I’ve reduced my AI to just a cube with box collider and rigidbody. It isn’t following the waypoint route at all. Not sure what is wrong:December 18, 2022 at 9:51 pm #5975
Take your move node and put it inside the waypointpatrol node. It needs to be a direct child.December 19, 2022 at 1:13 am #5980
The tutorial did not indicate the parenting.
Also, next issue - character stops at first waypoint and doesn’t continue.December 19, 2022 at 2:32 pm #5988
Waypoints have changed since we put together the tutorial. Make sure you do NOT have your move node set to repeat forever.December 20, 2022 at 12:10 pm #6019
hey there, look at the tips below which said :
Iterate through a set of Waypoint Route patrol points. blablabla….
Quick fix to make your patrolling works : change the move action to repeat until success.
Hope it helpsDecember 20, 2022 at 1:56 pm #6024
@kdoom - I generally recommend repeat Never. If you repeat until Success, then you might get stuck in a failure case.January 3, 2023 at 7:37 pm #6118
I am having the same issue. I set the move action as a child of the waypointpatrol node. Changed move to repeat never. Have the Move Target Variable set as moveTarget in the waypointpatrol node. Tried setting the Move Target on the move node as moveTarget and as “moveTarget”. “moveTarget” gets me past the move node to the animation node, but the AI just walks in place.January 3, 2023 at 11:30 pm #6121
Using 2.0.8?January 5, 2023 at 12:32 am #6133
I’m using 2.0.8 and had the same problem. Thanks to the information so far I managed to get my character to move to the closest waypoint node where it stopped moving.
Turns out the problem was due to me setting transform.position.z explicitly in a script, causing the character to be unable to reach the waypoint properly, and that got it stuck.
My advice is check that your other scripts do not interfere with the movement.January 6, 2023 at 9:41 pm #6166
The only script I have is a health script from following the tutorial. Only got through the first one. lol. I can make the AI do pretty much anything, except follow a simple waypoint route. I have the latest version. Project is a new project. Not sure what could be causing this. The AI walks in place, so it is getting to the animation. I will paste in a drop box link. Maybe you can see something I am not. It’s most likely something very simple.
January 6, 2023 at 11:13 pm #6169
- This reply was modified 2 years, 3 months ago by Brian Falkner.
Are you using RAIN’s Navigation Mesh? Or, are you just using the Waypoint Route or Waypoint Patrol?
If you are just using a Waypoint Route, see this post I made earlier: http://rivaltheory.com/forums/topic/upgrade-to-2-0-7-and-updating-waypoint-patrol/page/2/#post-6156
In a nutshell, if you are not using a Navigation Mesh generated by RAIN, try in the Motor section of your NPC’s AI and look toward the bottom. You should see three checkboxes:
Valid Path Required
By default, the Valid Path Required option was checked. When I ran my upgraded to 2.0.7 solution (it’s the same behavior for 2.0.8), my NPC would animate walking in place. If I went into Scene view and dragged him away from that point, he’d find a path back to his starting point.
If you uncheck the “Valid Path Required” box, you should see your NPC move along the Waypoint Path. In my case, that was a good start, but my NPC would get stuck at the first Waypoint Patrol node he came to.
By checking the “Allow 3DMovement” he began going back and forth between the WaypointPartrol nodes.
Hope that helps you out some. I was baffled for a while on it.
January 7, 2023 at 12:18 am #6171
- This reply was modified 2 years, 3 months ago by Aaron Mueller.
@Aaron Mueller - That did it. Removed Valid Path Required, checked allow 3DMovement and 3DRotation. AI is now wandering around the waypoints. I see you want to have the Move node as a child of the Waypoint node and the animate run parallel with the waypoint node. I had the animate node as a child of the waypoint node along with the move node and he just skates around like that :p
I appreciate the help on that one. Just now got dropbox loaded up on this computer. It’s new and I forgot I hadn’t done that yet.January 7, 2023 at 12:20 am #6172
and my name is spelled wrong. lolJanuary 7, 2023 at 7:04 pm #6188
Now that the AI moves throughout the waypoints correctly, I added the die animation. added in the constraint node. Set health > 0. I checked several times to make sure it is set up exactly like the videos. The problem is the AI dies first. If I make a change and then put it back it goes through the BT again and the AI starts walking. I have the constraint set to repeat never. If I change that to forever the AI starts going to the way points, but the Die animation stops working when I set health to 0. It does stop walking tho. It’s like the Health is not getting in fast enough. If that makes sense.January 7, 2023 at 7:13 pm #6189
Where are you setting health > 0?
You must be logged in to reply to this topic.