-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pathfinding patch #829
Pathfinding patch #829
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @metricrb, thanks so much for helping improve the Roblox creator documentation! Our technical writing team will review your pull request soon. In the meantime, please ensure you've read through the README.md, contribution guidelines, and style recommendations.
Hi @metricrb , this looks like a great change, but I tested it briefly and my character stopped at the first waypoint (did not continue onward). Could you please check how it works for you, or point out what may be happening in my test? |
Hi, @IgnisRBX, you are completely right. It seems that the example code I submitted had a small mistake caused by me when I was copying it out of my game systems to function as an example. Please try again with the most recent commit. Apologies for any inconvenience. |
Hi again @metricrb , |
This pull request has been inactive for 14 days. If it remains inactive for another 7 days, it will close. Please update or comment on this pull request to keep it open. 🙏 |
This pull request has been inactive for 21 days. It's closing now. Please feel free to reopen it if you still need it. 🙏 |
Changes
When we call Humanoid:MoveTo() from waypoint to waypoint, and use the MoveToFinished event to detect when the character reaches each waypoint it does work. However unlike the demo place and code portrayed in the documentation on Character Pathfinding, many games will not operate with smoothness due to the event having a delay on being communicated, leaving a stuttering NPC between nodes and overall a poor visual effect.
This is detrimental on considering performance in public games, unlike test baseplates with minimal events and memory.
To resolve this issue, I implemented a snippet of ClickToMoveController under Player > PlayerScripts > PlayerModule > ControlModule.
You should notice that ClickToMove controller does not register for MoveToFinished but instead uses its own logic to decide when to move to next waypoint - namely the RunService.RenderStepped event. This would avoid waiting for the delayed event.
https://devforum.roblox.com/t/npc-moveto-has-a-stuttering-effect-whilst-using-pathfindingservice/3067241?u=m_etrics
Checks
By submitting your pull request for review, you agree to the following: