0% found this document useful (0 votes)
36 views8 pages

Unity Scripts Beginner

Creating and attaching a script Script as a behaviour component Variables and functions Conventions and syntax Update and FixedUpdate Vector

Uploaded by

Hernando Nan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views8 pages

Unity Scripts Beginner

Creating and attaching a script Script as a behaviour component Variables and functions Conventions and syntax Update and FixedUpdate Vector

Uploaded by

Hernando Nan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Unity Scripts

BEGINNER
Creating and attaching a script
How to create a script How to add a script
• From Project panel • From project to hierarchy panel,
• Right click drag and drop to the game
• Create object
• C# Script

• In the inspector
• Select the Game Object
• At the bottom, Add Component •It´s already attached
• Write the desired script name
• Click on create and add
Script as a behaviour component
Variables and functions

Variable: box that contains information

Different Type of info: Different Type of box


Variables and functions
Function: Is like a “machine” that processes “boxes” content
Conventions and syntax
Update and FixedUpdate
Update FixedUpdate
Called every frame Called every physics step
Frame time varies Intervals are consistent
Movement of non physic obj Adjustin physics (Rigidbody) objects
Simple timer
It´s Good practice to use forces for
Input movement
Vector
Vector Moving object has a velocity
Velocity:
Denotes a position in space
Change in position/time
relative to origin (0,0)
Position 1 is 5,6
Velocity is 12,5 /hour
What is the new position after 1 hour?
Add currentPosition to velocity Vector

You might also like