Forum Discussion

Shards632's avatar
Shards632
MHCP Mentor
10 months ago

v212 typescript updates

  • some more infrastructure fussing with `BaseHorizonProperty`, `HorizonReferenceProperty`, etc. presumably to clean up some internals.
  • the options on `Raycast.raycast()` got their own named type: `RaycastOptions`
    • `layerType` and `maxDistance` like before
    • `stopOnFirstHit` is new
      •  if true, returns a 'StaticHit` if the layer or tag do not match. if false, will return a miss if the layer or tag don't match
    •  clarification that if the tags field on the Raycast is unset, it will match entities with any tag.

1 Reply

Replies have been turned off for this discussion
  • Note that the change to the HorizonReferenceProperty behavior this week may catch some people off guard if you were getting things like Vec3 or Quaternion or Color or whatever from a property, editing its value, and expecting that the value in the cached layer would also update automatically as a side effect.

    Such 'side effect' coding is frowned upon, because it makes it very difficult to understand whats going on. This week, with the HorizonReferenceProperty change, they seem to have made it so that things like Vec3, Quaternion, Color, etc return a clone of the cached layer value, rather than the actual value. Any changes you make to the returned value will NOT automatically update the cached value as a side effect.

    If you were depending on this behavior, check your code carefully after v212 and make sure you are setting the value back correctly where needed.