You need to be a student to view this content. Please login or become a student! :)

 

10
Leave a Reply

  Subscribe  
Notify of
Scott Nerland
Scott Nerland

I’ve double checked my code and it the same as in this video but two things happen every time: 1) if (playerController.isIdle) return; if (Input.GetKeyDown(KeyCode.UpArrow )) { gameObject.transform.rotation = Quaternion.EulerA (270, 0, 0); } if (Input.GetKeyDown(KeyCode.DownArrow )) { gameObject.transform.rotation = Quaternion.Euler(270, 180, 0); } if (Input.GetKeyDown(KeyCode.LeftArrow )) { gameObject.transform.rotation = Quaternion.Euler(270, -90, 0); } if (Input.GetKeyDown(KeyCode.RightArrow)) { gameObject.transform.rotation = Quaternion.Euler (270, 90, 0); } this will have the character rotate as intended but the raycast will come out before the actual rotate messing up collision. 2) if (!playerController.isIdle) return; if (Input.GetKeyDown(KeyCode.UpArrow )) { gameObject.transform.rotation = Quaternion.EulerA (270, 0, 0); }… Read more »

Isaac Jessen
Isaac Jessen

I AM SOOOOO IMPRESSED THERE ARE THOUSANDS OF VIDEOS HERE!

GiuseppeVale
GiuseppeVale

hi, i can’t understand why while the chicken is rotating it draw the raycast before the rotation, so it draw where the chicken is facing and not where is moving, for exemple, if i’m moving one step forward and the second step on the right, he draw 2 times forward. Can i get some simple help with this?

Tracy Eschenburg
Tracy Eschenburg

Player script setup video does not seem to be working

JohnFor
JohnFor

hawde

MichaelKru
MichaelKru

Using unity 5.4.2f2 personal, and just to make sure if I have it right in the GetComponent() is it n GetComponent Renderer()?

MichaelKru
MichaelKru

Hi, I still seem to have a problem there. my private Renderer renderer is being underlined by visual studio and mono develop.I have no errors but when I run my program and leaving my camera view GotHit() doesn’t seem to activate, Just to make sure in void Start I used chick.GetComponent(); and in void IsVisible()if (GetComponent().isVisible)
{
isVisible = true;
}

if (!GetComponent().isVisible && isVisible)
{
Debug.Log (“Player off screen. Apply GotHit()”);

GotHit ();

Please Help

Oscar Tor
Oscar Tor

Alright found out the fix to this for anyone using Unity 5.4.2f2 Personal instead of using this on void Start() { renderer = GetComponent(); //Use this one as it’s no obsolete in unity API just use GetComponent(); } for the IsVisible method use this. void IsVisible() { // player controller isVisible if (GetComponent().isVisible ) { isVisible = true; } if (!GetComponent().isVisible && isVisible) { Debug.Log(“Player off screen. Apply Gothit()”); GotHit(); } }

Oscar Tor
Oscar Tor

Player Controller is Visible.

I keep getting this error
error CS0200: Property or indexer UnityEngine.Component.renderer' cannot be assigned to (it is read only)
I also took the advice of the intelisense and it advisded me to convert it to a GetComponent<Renderer>(); but I get another error

error CS0200: Property or indexerUnityEngine.Component.renderer’ cannot be assigned to (it is read only)

having some trouble with this.

Oscar Tor
Oscar Tor

I’m getting a read only error any other way to set this up during the course of the tutorial i was able to modify some scripts and change it based on the new Unity but having trouble with this one.

Assets/Crossy Road/Scripts/PlayerController.cs(24,9): error CS0200: Property or indexer `UnityEngine.Component.renderer’ cannot be assigned to (it is read only)

SCHOOL OF GAME DESIGN