Search Unity

Question queryResult.TryGetTrait(TraitNames.Bounds2D, out Vector2 bounds) = false

Discussion in 'Unity MARS' started by wickedwaring, Oct 29, 2022.

  1. wickedwaring

    wickedwaring

    Joined:
    Feb 5, 2014
    Posts:
    32
    Hi,

    I have a custom action script which sits on my proxies:

    public void OnMatchAcquire(Unity.MARS.Query.QueryResult queryResult)

    {

    if (!queryResult.TryGetTrait(TraitNames.Bounds2D, out Vector2 bounds) ||

    !queryResult.TryGetTrait(TraitNames.Pose, out Pose newPose))

    throw new Exception("Bounds not available");

    This never used to throw the exception in previous project Mars 1.4, but in Mars 1.5 (I have reset up my scene so could be something I need to add to a proxy) it is returning FALSE for the bounds bit only, could someone help explain under what circumstance bounds would not be there.

    My proxy is has a plane trait condition and also alignment and min size condition added.

    Cheers
    Matt
     
  2. wickedwaring

    wickedwaring

    Joined:
    Feb 5, 2014
    Posts:
    32
    How do I get some targeted support as a paid MARs user when stuck with something like this?

    Thanks.
     
  3. wickedwaring

    wickedwaring

    Joined:
    Feb 5, 2014
    Posts:
    32
    If I cannot use Bounds2D trait on my planes, could someone give me the MARS code for using in a ProxyAction on how to get the real world size of the current plane bounds of the current proxy, thank you.