When utilizing the new controllers Roblox introduced recently, I’ve come across a few problems that are drawn between either incorrect usage, or platform implementation issues.
Recently, I’ve started to program an enemy AI utilizing the Roblox ControllerManager and GroundController Instances. At its core, I wanted to have a server physics root, in which the client could render the enemy model on top of. I could successfully implement this logic utilizing humanoids previously, so I assumed this feature could support this.
A few issues popped up while making this.
Client physics sleep applying to objects welded to the server physics root (not following the server-moving object that chased the player)
Incorrect movement dynamics while welded, the controller starts moving in all sorts of different directions on the client. (All client welded objects have no collisions, mass, or anchored state set to true)
Physics launching the object on the client, similar to the problem above, but the server root (which should not be impacted by the client objects) has some pretty crazy movement on the client, whereas retaining normal physics on the server.
Now look, a lot of this should seem like regular physics replication issues stemming from client alteration, but in my case none of the objects should, and are not intended to interact with the server physics root. Upon a lot of testing with custom physics properties, massless states, and testing with client physics sleep, I have not found a reliable solution to this problem.
For further information, the server root controller sets its movedirection to move towards the player about every 1/15 of a second, secondly, there is a velocity applied to the root every 4 seconds to simulate jumping forward.
Here are some screenshots and videos for visual representation.
Controller Physics Directions.
- With Client Welded Model -
https://gyazo.com/2386d3f301d5fb355fb03ed915f922a3.mp4
https://gyazo.com/99c599ac5e81f17a76c465f1d1113cc1.mp4
(In the video, the object is actually moving away from the client, when it should be chasing the player)
-Server Intended Behavior With Client Side By Side
-Complete Intended Server Behavior
https://gyazo.com/15e79ab36f75b5860e9351cf912f875b.mp4
https://gyazo.com/c98984f90ebd5cf03d68f7db39127f86.mp4
Client Code Fragment
https://gyazo.com/639d5245c545337362ae8f94e2349818
(the server code works normally, as intended, but when the following code applies a client model overlay, problems occur)
Overall, im looking for a solution that allows me to attach a client model to the server physics root without needing any additional logic to maintain the model overlay.
Thank you for your time.