Places an object at the hit point of a raycast
Raycast.Prefab-14.mp4
- If you dont already have Final IK installed, download and install the Final IK Stub.
- Note: Testing in Unity is not possible when using the Final IK Stub!
- Drag & drop the
Raycast
prefab into the base of your Hierarchy. - Right click and unpack the prefab, then drag & drop it onto your avatar.
- By default, the raycast aims down from the
Casting Target
object.- If needed, you can move and rotate the
Casting Target
object until it "aims" at your target.
- If needed, you can move and rotate the
- Place the objects you want to raycast under the
Container
GameObject or constrain them to theContainer
GameObject.- World Particles can't be Constrained to the
Container
GameObject and have to be parented to theContainer
object instead due to "Fix Transforms" affecting the emission location.
- World Particles can't be Constrained to the
- In game, the
Container
object will raycast down from theCasting Target
onto any Collider which matches the Layers set up in theGrounder
's Grounder IK Script (by default this is:Default
,Ignore Raycat
,Water
andEnvironment
).- Note that you can't change layers on your avatar. Local avatar layers will always be
PlayerLocal
andMirrorReflection
, and remote avatar layers will always bePlayer
(with the exception of UIMenu).
- Note that you can't change layers on your avatar. Local avatar layers will always be
- VRChat uses Final IK v1.9. If you are using a different version you may experience differences in behavior when testing with Final IK.
Constraints: 2
Constraint Depth: 2
Colliders: 1
Raycast
|-Container
| |-Cube
| |-Cube
|-IK
| |-Grounder
| | |-Offset
| | | |-End
|-Floor
|-Casting Target
Raycast Prefab is available as-is under MIT. For more information see LICENSE.