This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class raySet : MonoBehaviour { | |
float y; | |
void FixedUpdate () | |
{ | |
Vector3 fwd = transform.TransformDirection (Vector3.forward * 10); | |
Debug.DrawRay (transform.position, fwd, Color.blue, 0.1f); | |
if (Physics.Raycast (transform.position, fwd, 200)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class raySet : MonoBehaviour { | |
float y; | |
void FixedUpdate () { | |
y -= Input.GetAxis("Mouse Y"); | |
if (y >= -90 && y <= 90) { | |
Debug.Log (y); | |
transform.localRotation = Quaternion.Euler (y, 0, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class PlayerControll : MonoBehaviour { | |
float mouseX; | |
Rigidbody rigidbody; | |
void Start(){ | |
rigidbody = GetComponent<Rigidbody> (); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class PlayerControll : MonoBehaviour { | |
float mouseX; | |
Rigidbody rigidbody; | |
void Start(){ | |
rigidbody = GetComponent<Rigidbody> (); | |
} |