Get the App
SLTechnology News&Howtos  ›  Servers  › 

VR realizes the super handsome loading magazine in the movie.

Shulou Source: shulou.com Published: 2022-06-02 10:29:46 10月04日 Update

The author is obsessed with gun battles and personal heroism. All right, can we cut the crap and get to the point.

For the action of changing * for *, what is designed here is that you only need to swing the * slightly from the front side of the thigh to the back side of the thigh, ok, and reload.

Hey, let's go straight to the code here.

First of all, this is a self-made VR project, so you can't sneak out the entire script source code, so you can take out the functions that implement this function.

The script is mounted directly on the left and right handle.

The next train of thought, in fact, is to check the rotation angle of the handle, using the eulerAngles. To determine whether you are from one angle to another, coupled with timer control, you can detect our handsome gun throwing action. It should be noted that because of the problem of fault tolerance, your first decision angle had better limit the rotation angle of the three axes.

Voidhuandan ()

{

If (transform.eulerAngles.x > = 68 & transform.eulerAngles.x

/ / check the X rotation angle of the handle

{

If (transform.eulerAngles.y > 230&&transform.eulerAngles.y < 260)

/ / check the Y rotation angle of the handle

{

If (transform.eulerAngles.z

Tags: Handle angle check timer action that is script handsome magazine three personal doctrine code author function function thigh nonsense idea time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Docker macOS MariaDB Shulou Tech Info