Sword slashing logic on Gear VR using controller?
Description I have a Gear VR game that has a sword fight level and I want to inflict damage to enemies when the player swayed their sword and hits the enemy. Figured I can do this with collision but there are certain problems that I need to address. Background of the problem I replaced the Gear VR model to a sword model basically and I can sway the sword with no problem but I want to only damage the enemy if it has been swayed/slash before hit. Main Question The sword should not damage an enemy if the user did not sway the sword hard and fast. The problem is if the sword collided with an enemy (getting near) it will inflict damage because of the OnCollisionEnter. How can I do this the smarter way? I need to check if it has been slashed. (Check velocity of Gear VR controller upon hit perhaps?) For now, I am still testing possible solution to my problem and will be posting here as answer if I discovered any. Meanwhile, any ideas or answers in regard with this problem is welcome. Thank you for your help.492Views0likes0CommentsOvr controller weird rotation
Hello, I am trying to create a shooting game for occulus gear vr. My gun which will be controlled by gear vr controller has a script attached with the following code Quaternion controllerRotation = OVRInput.GetLocalControllerRotation (OVRInput.GetActiveController ()); transform.rotation = Quaternion.Slerp(transform.rotation, rotation, m_Damping * (1 - Mathf.Exp(k_DampingCoef * Time.deltaTime))); Hierarchy of the player and gun is like this Now whenever Player transform rotation is set to 0,0,0. player and gun looks like this. But whenever I change the rotation of player to anything other than 0 the gun's rotation is something else. For eg when players rotation is set to 0,90,0 , the view looks like this I have different different missions in my game and in some missions I have to change the initial rotation. Whenever I change the rotation of player it becomes very hard for the user to bring the gun to the camera view. How to set players initial gun (gear vr controller) rotation to 0,0,0 ?526Views0likes0Comments