armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer. # InkyJinx

782

42 Excellent

• Rank

• Gender
Not Telling

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. Hey, i was wondering if anyone knew if that everything under the 'Unity Essentials' tab on the asset store can be reused in a sold asset for profit? Thankchuu
2. Mhmm okay reword this, able to make it move on the Z Axis, when normally looking on the Y axis. Sound better?
3. Hey guys, im in need of converting this lovely mouselook script to being able to look on the Z-axis, it seems like it should be pretty simple, a bit of swapping around it's just not happening for me, can anyone help me in converting this to Looking on the Z-Axis when normally looking on the Y-Axis? Thankyous! **Solved** public enum RotationAxes { MouseXAndY = 0, MouseX = 1, MouseY = 2, MouseZ = 3 } public RotationAxes axes = RotationAxes.MouseXAndY; public float sensitivityX = 15F; public float sensitivityY = 15F; public float sensitivityZ = 15F; public float minimumX = -360F; public float maximumX = 360F; public float minimumY = -60F; public float maximumY = 60F; public float minimumZ = -60F; public float maximumZ = 60F; float rotationZ = 0F; float rotationX = 0F; float rotationY = 0F; private List<float> rotArrayX = new List<float>(); float rotAverageX = 0F; private List<float> rotArrayY = new List<float>(); float rotAverageY = 0F; public float frameCounter = 20; Quaternion originalRotation; void LateUpdate () { PhotonView pv = this.gameObject.GetComponent<PhotonView> (); if (pv.isMine) { if (axes == RotationAxes.MouseXAndY) { rotAverageY = 0f; rotAverageX = 0f; rotationY += Input.GetAxis("Mouse Y") * sensitivityY; rotationX += Input.GetAxis("Mouse X") * sensitivityX; rotArrayY.Add(rotationY); rotArrayX.Add(rotationX); if (rotArrayY.Count >= frameCounter) { rotArrayY.RemoveAt(0); } if (rotArrayX.Count >= frameCounter) { rotArrayX.RemoveAt(0); } for(int j = 0; j < rotArrayY.Count; j++) { rotAverageY += rotArrayY[j]; } for(int i = 0; i < rotArrayX.Count; i++) { rotAverageX += rotArrayX[i]; } rotAverageY /= rotArrayY.Count; rotAverageX /= rotArrayX.Count; rotAverageY = ClampAngle (rotAverageY, minimumY, maximumY); rotAverageX = ClampAngle (rotAverageX, minimumX, maximumX); Quaternion yQuaternion = Quaternion.AngleAxis (rotAverageY, Vector3.left); Quaternion xQuaternion = Quaternion.AngleAxis (rotAverageX, Vector3.up); transform.localRotation = originalRotation * xQuaternion * yQuaternion; } else if (axes == RotationAxes.MouseX) { rotAverageX = 0f; rotationX += Input.GetAxis("Mouse X") * sensitivityX; rotArrayX.Add(rotationX); if (rotArrayX.Count >= frameCounter) { rotArrayX.RemoveAt(0); } for(int i = 0; i < rotArrayX.Count; i++) { rotAverageX += rotArrayX[i]; } rotAverageX /= rotArrayX.Count; rotAverageX = ClampAngle (rotAverageX, minimumX, maximumX); Quaternion xQuaternion = Quaternion.AngleAxis (rotAverageX, Vector3.up); transform.localRotation = originalRotation * xQuaternion; } else { rotAverageY = 0f; rotationY += Input.GetAxis("Mouse Y") * sensitivityY; rotArrayY.Add(rotationY); if (rotArrayY.Count >= frameCounter) { rotArrayY.RemoveAt(0); } for(int j = 0; j < rotArrayY.Count; j++) { rotAverageY += rotArrayY[j]; } rotAverageY /= rotArrayY.Count; rotAverageY = ClampAngle (rotAverageY, minimumY, maximumY); Quaternion yQuaternion = Quaternion.AngleAxis (rotAverageY, Vector3.left); transform.localRotation = originalRotation * yQuaternion; } } } void Start () { PhotonView pw = this.gameObject.GetComponent<PhotonView> (); if (pw.isMine) { if (GetComponent<Rigidbody>()) GetComponent<Rigidbody>().freezeRotation = true; originalRotation = transform.localRotation; } } public static float ClampAngle (float angle, float min, float max) { angle = angle % 360; if ((angle >= -360F) && (angle <= 360F)) { if (angle < -360F) { angle += 360F; } if (angle > 360F) { angle -= 360F; } } return Mathf.Clamp (angle, min, max); }
4. ## Changing int across photon network

So ive got a gameobject, with an int called points in my photon game scene, and im trying to make it be the same for every player..any ideas? also any ideas on how to use += and have it over all builds too? Thanks .. (:
5. ## Making HUD change with resolution

The hud i got off the internet, it was from halo, was just using as an example
6. ## Making HUD change with resolution

Worked! Beautiful, thanks man
7. ## Making HUD change with resolution

I've never used draw texture, ill give it a go, thanks - And its off the net, filled with copyright, but go for it ;P
8. ## Making HUD change with resolution

Hey guys, i was wondering if anyone knew how to make a gui that stretches to each corner if the resolution is changed, im trying to create a helmet hud as seen in the halo sequel, im stuck..if you can help thankyou lots! Example :
9. Will do