Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Unity&Unreal SCRIPTING

No description
by

Ian Tierney

on 30 September 2017

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Unity&Unreal SCRIPTING

C++
Blueprints
Unreal
Javascript
C#
Boo

UNITY
Awake() and Start()
Actor:
any object that can be placed into a level.
Pawn:
physical representation of a player or AI within the world.
Character:
Pawn that can walk around.
Controllers
non-physical Actors that possess a Pawn. 1-to-1 relationship between Controllers and Pawns
Component
:piece of functionality, added to an Actor.
Definitions
Called every frame.
Used for:
Detecting input
Moving objects.
Timers.
dt may vary

UPDATE()
SCRIPTING
Both called once when a script is loaded.
Awake(): used for initialisation setting up references between scripts. (Like a constructor).
Start(): called just before the first update
Set up things that depend on other components.

Called every physics step
dt is the same
Used for updating physics

FixedUpdate()
Gameojects
: Characters, lights, enviroments are all gameobjects
Components
give them different properties.
Prefabs
act as a templates to create object instances in the scene. Edits made to a prefab are immediately reflected in all instances.
Events
Unity passes control to a script intermittently by calling certain Event functions. When the function has finished executing, control is passed back to Unity.

Definitions
Variables:
are properties that hold a value or reference an Object or Actor in the world.
variables are rounded boxes and color coder
Types: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Variables/index.html
Variables
Blueprint Class:
often shortened to "Blueprint" is an asset that allows you easily add functionality on top of existing gameplay classes.
Level Blueprint:
is a specialized type of Blueprint that acts as a level-wide global event graph.
Common Types of Blueprint
Connect pins and represent the flow execution or data.
Wires
To set up bindings:
Edit->Project settings->Input
float h = Input.GetAxis("Horizontal");
Axes have negative and positive buttons
Input Axis
You Activate GameOjects
gameObject.SetActive(true);
Your Enable components
myLight = GetComponent<Light>();
Activate vs Enable
Inside your Blueprint, click the Debug Object drop-down menu, then select the instance you wish to see in the debugger.



Click Magnifying glass
Debugging Blueprints
Online Session Nodes:
The nodes below are responsible for hosting, discovering, joining or leaving multiplayer games through Blueprints.
Math Expression :
Maths operators and functions.
RandomStreams
allow repeatable, random numbers to be generated
Comments:
added directly to single Blueprint nodes, or they can be added as comment boxes to group related nodes and provide descriptions about their functionality.
Nodes
Buttons:
bool down = Input.GetButtonDown("Jump");
bool held = Input.GetButton("Jump");
bool up = Input.GetButtonUp("Jump");
Keys:
bool down = Input.GetKeyDown(KeyCode.Space);
bool held = Input.GetKey(KeyCode.Space);
bool up = Input.GetKeyUp(KeyCode.Space);
Input Presses
Events
: called from gameplay code to begin execution of an individual network within the EventGraph.
EG:LevelReset events sends out an execution signal when the level restarts.
Events
Graph
network of nodes that can be connected to one another in order to define the flow of execution for the network.



Each new Blueprint will contain one
EventGraph
when it is created.
Graphs
NODES
Custom Events
provide you with a way to create your own events that can be called at any point in your Blueprint's sequence.
Function calls
By binding one or more events to an
Event Dispatcher
, you can cause all of those events to fire once the Event Dispatcher is called.
Nodes
Casting
By using the Get Player Character node, then using a Cast To MyCharacter node (the special Character Blueprint), you can then say if the Player Character is MyCharacter
Flow Control
The default flow control operations include branches (if statements), loops (for and while), gates, and sequences.
Array Nodes
: handling arrays
Timeline
simple values to be animated and events to be fired off over time.
Nodes

Represent inputs and outputs to/from node.
Pins
Execution pins are used to connect nodes together to create a flow of execution

Execution pins
Data Pins
Creates a new variable, wires it to the data pin being promoted.
Promote to Variable
Data pins are type-specific and can be wired to variables of the same type or a data pin of the same type on another node.
Connections can be made between certain pins of different data types by way of the auto-casting feature.
Right-click on an execution node to Add Breakpoint or press F9
Cause execution to stop at this point
Breakpoint

Watching Variable
Window -> Developer Tools section
Blueprint Debugger
container for a function (similar to c++ function pointers )
Also allows you to iterate through multiple functions.
Foo myDelegate = One;
myDelegate += Two;
myDelegate(); // Will call One then Two
See code example: unity3d.com/learn/tutorials/modules/intermediate/scripting/delegates
Delegate
Important Classes:MonoBehaviour
Breakpoints
Similar controls to what you are used to in code
Right-click on a variable and select the Watch this value.
Position, rotation and scale of an object.
Transforms can have a parent.
docs.unity3d.com/ScriptReference/Transform.html
Transform
Update object's position through physics simulation.
AddForce()
AddTorque()
GetPointVelocity()
docs.unity3d.com/ScriptReference/Rigidbody.html
Rigidbody
is the base class every script derives from.
Input
OnMouseDown()
Collision
OnCollisionEnter()
Triggering
OnTriggerEnter()
Many many more....
docs.unity3d.com/ScriptReference/MonoBehaviour.html
Called after the Update() and FixedUpdate() functions have been called for all objects in the scene & after all animations have been calculated.
EG If you wanted a camera follow a target object;move the camera’s orientation must be made after the target object has moved.
LateUpdate()
Update object's position through physics simulation.
AddForce()
AddTorque()
GetPointVelocity()
docs.unity3d.com/ScriptReference/Rigidbody.html
Rigidbody
Full transcript