Hi I'm new to java script so this is probably really easy but is there a way to detect a key press such as the up arrow.
This is my current code.
orb.setVelocity( 10 );
Yep, that should work. Looks like you're missing a semicolon inside of your Eval; fix that and you should be good to go.
I tried that still didn't work.
This is the error message I get.
ERROR:spell1:Spell error when trying to execute function (onCreate):
ReferenceError: Input is not defined
I'm guessing that the error is that CodeSpells doesn't know KeyUp?
Ah, yeah. Unity doesn't use "KeyUp". Instead you can either use Input.GetKey("up"); or Input.GetKey(KeyCode.UpArrow);. Here's the Unity documentation on Input.GetKey(): https://docs.unity3d.com/ScriptReference/Input.GetKey.html
KeyUp is an event that occurs when a key is released. So, you can use Input.GetKeyUp("up"); to check whether the key is being released. It is an event that occurs during the frame that a key is released.
OK. Thanks. Sorry for the late reply.