SetParent

Sets the parent of the canvas to the new parent transform. Useful for VR applications and World Space canvases.

using UnityEngine;

public class RadialMenuExample : MonoBehaviour
{
	// BE SURE TO ASSIGN THIS IN THE INSPECTOR //
	public UltimateRadialMenu radialMenu;
	public Transform rightHandTransform;

	void Update ()
	{
		// If the space bar has been pressed...
		if( Input.GetKeyDown( KeyCode.Space ) )
		{
			// Set the parent of the radial menu to the right hand transform assigned in the inspector.
			radialMenu.SetParent( rightHandTransform, Vector3.zero, Quaternion.identity );
		}
	}
}

Last updated