-
Hey! Got a quick question, are there any plans on extending the typical scene queries to detect hits on CharacterVirtual instances? During the Ludum Dare game jam I noticed that Jolt doesn't seem to detect when a shape cast or ray cast hits a shape belonging to a CharacterVirtual. Are there any plans on adding native support for this? I know that I could probably work around it by explicitly creating a Body for any Character that needs to be detectable by scene queries, and ensuring that the backing body is always in the same location as the character, but I'd rather avoid it unless I have to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
CharacterVirtuals are indeed not backed by a physics body, but you can easily create a TransformedShape from the character's (center of mass) position and shape and use that to do shape/ray casts against (just call that in addition to your regular query on the scene). Please see #239 for more information on how you could make an internal rigid body, which is indeed the alternative way of fixing this. |
Beta Was this translation helpful? Give feedback.
The TransformedShape class can be constructed from the position and shape of the character and offers a CastRay etc. function. If you pass the same collision collector you're passing to the scene to it you'll get a combined collision result for scene + character