Unity - Check if Rigid Body Visible

NatNet, VRPN, TrackD, and Plugins
Post Reply
illuminant_eldrick
Posts: 2
Joined: Sat Jan 28, 2023 8:55 am

Unity - Check if Rigid Body Visible

Post by illuminant_eldrick »

Hello,

Is there anyway to check if a Rigid Body is visible using the Unity plug in? I've checked OptitrackStreamingClient.cs and cannot find a field or method I can use to determine this status.

The Rigid Body script always updates the rigid body position to the last seen position, so it seems that it's not actually possible to know, based on the Rigid Body's data, if it is actually visible but just staying *very* still, or not visible at all.

Thanks in advance
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 720
Joined: Mon Jan 19, 2015 11:52 am

Re: Unity - Check if Rigid Body Visible

Post by steven.andrews »

Hello illuminant_eldrick,

Thank you for sharing this question with the community.

The Unity plugin does not currently have functionality for determining when the rigid body is tracked. Technically, that information exists in the streamed data, but the scripts pulling information do not give access to that.

You may be able to adjust the scripts to access additional rigid body information, but this work has also been completed by our development team. When we next release an update for the Unity plugin, there should be a flag that indicates if the rigid body is untracked.
I do not have a timeline for the next release, but I believe we may make it available around the time we release Motive 3.1.

Cheers,
Steven
--
Steven Andrews
OptiTrack | Director, Support Engineering
help.naturalpoint.com
docs.optitrack.com
support@optitrack.com
alishakihns
Posts: 1
Joined: Thu Aug 10, 2023 9:49 pm
Location: https://drift-boss.pro

Re: Unity - Check if Rigid Body Visible

Post by alishakihns »

In Unity, to check if a rigid body is visible, you typically need to consider the visibility of its associated GameObject or MeshRenderer component. The RigidBody component itself does not have a direct property or method to determine visibility.

Here's an example of how you can check the visibility of a GameObject associated with a rigid body:
Post Reply