JuanLouTech
JuanLouTech
NNormal
Created by JuanLouTech on 5/30/2024 in #🤝ask-a-question
What is the best way to keep in sync a variable in the form of float array?
Thanks @NormalMark . It worked but I can't use it because one of the ints I need to send is an animation hash (32 bits) and when the Vector2 is received on the other clients it changed the value since floats can't keep 32 bit whole part of the number. I Also tried a walk around the "double" type precision problem (I was having some too with my hacky solution) using a long in which I store in the first 32 bits the animation hash and in the last 32 bits the timestamp (multiplying the time stamp by 1000 and casting it to an int, keeping the 3 decimals precision) . But it turns out longs are not serialized natively neither. I'd rather not use a string to encode this because of it's weight for network load but for now it seems the only truly reliable solution for what I need to achieve with the default supported types.
25 replies
NNormal
Created by JuanLouTech on 5/30/2024 in #🤝ask-a-question
What is the best way to keep in sync a variable in the form of float array?
I ended up encoding the int and the float I need in a single double since Vector2 did not seem to work and Vector3 was a waste of bandwidth for what I wanted. It was a weird hack but worked as a charm. 🤷‍♂️
25 replies
NNormal
Created by JuanLouTech on 5/30/2024 in #🤝ask-a-question
What is the best way to keep in sync a variable in the form of float array?
@Normcore Assistant , this is not working either. I'm getting this error whe ntrying to compile the model : ArgumentException: Unsupported serialization type: System.Single[] (Field: _animationTriggerHash). Property must be a primitive type or an object that inherits the RealtimeModel class. Normal.Realtime.RealtimeModelCompiler.GetModelLayoutForClass (System.Type modelClass) (at <2fafecb97aaa43138ec971f0d51fa4d7>:0) Normal.Realtime.RealtimeModelCompiler.GenerateModel (UnityEditor.MonoScript script) (at <2fafecb97aaa43138ec971f0d51fa4d7>:0) Normal.Realtime.RealtimeModelCompiler.TryGenerateModel (UnityEditor.MonoScript script) (at <2fafecb97aaa43138ec971f0d51fa4d7>:0) UnityEngine.Debug:LogException(Exception) Normal.Realtime.RealtimeModelCompiler:TryGenerateModel(MonoScript) Normal.Realtime.Serialization.ModelEditor:OnInspectorGUI() UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) The _animationTriggerHash property is defined as a reliable Vector2 in the model. Since I'm on the 3.0.0 Webgl-alpha this might be a version problem.
25 replies
NNormal
Created by JuanLouTech on 5/30/2024 in #🤝ask-a-question
What is the best way to keep in sync a variable in the form of float array?
@Normcore Assistant Would Vector2 work natively?
25 replies
NNormal
Created by JuanLouTech on 5/30/2024 in #🤝ask-a-question
What is the best way to keep in sync a variable in the form of float array?
@Normcore Assistant , but I'm getting an error because the float[] is not natively serialized
25 replies
NNormal
Created by JuanLouTech on 5/16/2024 in #🤝ask-a-question
Model is "frozen" (stops updating) when owner leaves. How to avoid this?
Thanks @Max , this is what I'm doing right now.
9 replies
NNormal
Created by JuanLouTech on 5/16/2024 in #🤝ask-a-question
Model is "frozen" (stops updating) when owner leaves. How to avoid this?
@Normcore Assistant I'm aware of the clearOwnership function as well as the other things you suggested. I was not able to make my custom model update a countdown once the owner leaves, it remains stuck at that second. Regarding rigid bodies my guess is that the problem lies in the fact that when a user has the object picked up it's isKinematic flag is set to true, so if the player holding it leaves remains kinematic and never wakes up.
9 replies
NNormal
Created by mstfmrt07 on 5/8/2024 in #🤝ask-a-question
Handling Ownership Requests that are older than the newest requests
Hi! I'm interested in this thread since my game also involves interactions with rigid bodies. @Max , you're suggesting handling the physics manually instead of a rigid body, right? I mean, code the ball as a kinematic body and handle it's velocity in a predictable way, isn't it? I did not consider that option but if you don't need very realistic physics might be a good one.
10 replies
NNormal
Created by JuanLouTech on 4/23/2024 in #🤝ask-a-question
How can I trigger a change on a remotely owned model and get it synced on all clients?
Thanks! I did not know about this. The way I was handling events and triggers was with the typical int increment in a custom model. This is way better for interactions between players.
20 replies
NNormal
Created by JuanLouTech on 4/23/2024 in #🤝ask-a-question
How can I trigger a change on a remotely owned model and get it synced on all clients?
@Normcore Assistant , are RPC messages usable on WebGL? I am working on a Web application.
20 replies