Raycasting in TrueSync
The TrueSync raycast has the following signature:
bool Raycast(TSVector rayOrigin, TSVector rayDirection, RaycastCallback raycast, out IBody body, out TSVector normal, out FP fraction)
Its not immediately obvious what we get out, but most importantly there is no way to filter using layers?
Why is there a callback AND out parameters?
We can use Unity's ray casting for some use cases, however to do so we need to add a standard collider in addition to the TSCollider, is that an issue (if we set it as trigger)?
bool Raycast(TSVector rayOrigin, TSVector rayDirection, RaycastCallback raycast, out IBody body, out TSVector normal, out FP fraction)
Its not immediately obvious what we get out, but most importantly there is no way to filter using layers?
Why is there a callback AND out parameters?
We can use Unity's ray casting for some use cases, however to do so we need to add a standard collider in addition to the TSCollider, is that an issue (if we set it as trigger)?
0
Best Answer
-
Hi @Geminior,
The API related to raycast and its implementation we are still working on it, as you can see it has a different signature from Unity, we should release something for next update (version 1.0.8). You should not use Unity's raycasting because the execution is not deterministic, this will probably lead to a desynchronization between game clients.5
Answers
-
Hi @Geminior,
The API related to raycast and its implementation we are still working on it, as you can see it has a different signature from Unity, we should release something for next update (version 1.0.8). You should not use Unity's raycasting because the execution is not deterministic, this will probably lead to a desynchronization between game clients.5 -
Thanks we will look forward to 1.0.8 then.
For the record, when I say we use Unity raycasting it is only for stuff that is local client only, e.g. selecting a unit and looking at its stats.0