You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.
I've recently been developing a minigolf SDK and as of the update this week my Rigidbody physics which I was applying to the ball no longer works. I can no longer AddForce or set the velocity as I was doing before. logging the rigidbody's velocity length after using AddForce prints 0s as if it hasn't been applied and setting the velocity manually returns the length of the vector it has been set to so it has been applied but has no visible effect in-game. I've tried creating a new project to isolate this behaviour but I'm still having no luck applying a force to it. This is a behaviour I had working before and initially I thought it might have been that because I was updating my kit objects last week it was using a cached version and the new version had something different but having tried to isolate the behaviour in the following script I think it might be a bug.
An actor needs to have an owner when using rigidBodies, otherwise the client side portion of the SDK will not add the actor to the physics bridge, or perform any action such as addForce().
I discovered that when actors are created immediately after the onStarted() event, the SDK fails to properly update each actor's owner once the authoritative user joins. The _rigidBodyDefaultOwner is still undefined at this point.
Actors with rigidBodies for physics simulation require a different method of instantiation than how the sample apps are doing it (e.g. creating actors after onStarted()). This isn't known since there is a lack of documentation on the matter.
The below is an example of a pattern that can be used to assist with getting around the issue mentioned above.
For the SDK devs: A better pattern would be for the onStarted() event to fire once the authoritative user is known and the _rigidBodyDefaultOwner property has been defined.
If an actor is intended to be exclusive, it's best to set the the owner manually.
"I discovered that when actors are created immediately after the onStarted() event, the SDK fails to properly update each actor's owner once the authoritative user joins. The _rigidBodyDefaultOwner is still undefined at this point."
I found a fix that ensures actors created without owners properly receive the default owner when created within this.context.onStarted(() => .... See the referenced PRs.
Hi,
I've recently been developing a minigolf SDK and as of the update this week my Rigidbody physics which I was applying to the ball no longer works. I can no longer AddForce or set the velocity as I was doing before. logging the rigidbody's velocity length after using AddForce prints 0s as if it hasn't been applied and setting the velocity manually returns the length of the vector it has been set to so it has been applied but has no visible effect in-game. I've tried creating a new project to isolate this behaviour but I'm still having no luck applying a force to it. This is a behaviour I had working before and initially I thought it might have been that because I was updating my kit objects last week it was using a cached version and the new version had something different but having tried to isolate the behaviour in the following script I think it might be a bug.
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: