In Unity, the same thing can be done with the following script.
Bellow is the detailed comparison between commands in Scratch and in Unity related to the above Script.
If then Command
In ScratchIn Unity
It means, if the condition between the ( and ) symbols is true then execute all commands that exist between the { and } symbols bellow the if command.
If then else Command
In Scratch
In Unity
It means if the condition between the ( and ) symbols is true then execute all commands that exist between { and } symbol bellow the if command, and if the condition is false then execute all commands that exist between { and } symbol bellow the else command.
Is Right Arrow Key Pressed?
In ScratchIn Unity
Is A Key Pressed?
In Scratch
In Unity
Tidak ada komentar:
Posting Komentar