Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

changing maxSidewaysSpeed in a script

$
0
0
so, i have been looking for about one hour now trting to find the solution to this, but i have failed. what i want to do, is when the player is holding down LMB and has an attack score of 1, to change sprites (up untill now its working, but from here it isnt) and then change the maxsidewaysspeed variable in the caractermotor to 0, and the gravity to 70, and disable jumping, however, all i got is this. `#pragma strict static var attack : boolean; function Start () { } function Update () { %|-559768356_2|% FirstPersonController = GetComponent(CharacterMotor);** %|1479974020_4|% %|1883339760_5|% %|-1953697181_6|% %|-1650427946_7|% %|-1786140168_8|% %|150390145_9|% %|545168503_10|% %|-205636262_11|% } else if(Input.GetKey("d")){ %|487895405_13|% } else if(Input.GetKey("left")){ %|-1024249040_15|% } else if(Input.GetKey("right")){ %|-772833627_17|% } else { AT.rowNumber = 0; } }` things in > ** ** are bugged things, wich need to be debugged, (i get a nullrefrenceexecption) and some things need to be added, can someone debug this code (and maybe add the gravity and such to it) for me? i would highly appriciate it (please no links to another question since i probably already saw it) my player object is called FirstPersonController and im trying to access the default CaracterMotor script. (its still in the standard assets folder) (coding is in JS) thanks in advance :D

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>