翻訳がありません。下の翻訳ボタンを押してください。here. To start off, download free bow and arrow models from 3dwarehouse.sketchup.com. Make sure to turn the models into prefabs and making them a child of an empty object. We will do this as sometimes; models can be tricky to deal with so it is better to envelope them in a game object. Now that we have the prefabs ready, setup the uploadable prefab for STYLY. Follow the setup state in this tutorial. Once one of the controller is ready, simply copy that object, duplicate it, change its name to whatever seems appropriate. You will need to change a few other things such as the name of the object you are trying to find from “Controller (right)” to “controller (left)”. Similarly, change event names from “Global_TriggerDown_R” and “Global_TriggerUp_R” to “Global_TriggerDown_L” “Global_TriggerDown_L”. If you feel you have no idea about what I am talking about, please read this tutorial. Once both the controllers are setup, play around with the new models placement until you feel the placement of the objects is realistic in Virtual Reality. Once done, move on towards setting up the right controller which is what I will be using as an arrow. State 1 is empty. State 2 is where we create the object. Notice how the transitions in the state machine help release only 1 arrow at a time. Now the fun part starts. We want the arrow to go the furthest when our arms are stretched and we are in an archery position. We do not want the arrow to go too far if the arrow has not been pulled back enough. The key here is distance. The distance between the 2 controllers. We can simply get the distance in 3 easy actions in the arrow. We will use the following actions.
- Find Game object (find: “Controller (left)”, store in: Controller_L )
- Find Game object (find: “Controller (right)”, store in: Controller_LR)
- Get distance (Game Object: controller_L, target: controller_R, store in: forceMultiplyer)