I have a Light_Spell script attached to a magic wand which is parented to a Razer Hydra hand object. The Light_Spell takes a prefab of a Light which is projected out of it when a button is pressed.
However the light is just moving up, no matter what way I rotate the hand object, it always goes up. I had it working but I changed some code around and can’t remember how I got it working in the first place.
Here is the code I have so far:
if (isSelectedSpell && SixenseInput.Controllers[0].GetButtonDown (SixenseButtons.BUMPER) && triggerIsPressed == false) {
Rigidbody instantiateProjectile = Instantiate(wandLightProjectilePrefab, transform.position, transform.parent.transform.rotation) as Rigidbody;
}
I have tried setting Vector3 to up and forward and a whole set of different things. Any ideas on what I should do to make it match the rotation of where the hand is pointing and stuff?
Thanks