Fundaments of Game Design

Slides:



Advertisements
Similar presentations
events reactive programming
Advertisements

Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
INNER WORKINGS OF UNITY 3D. WHAT WE ARE GOING TO COVER Intro to Unity Physics & Game Objects Cameras & Lighting Textures & Materials Quaternions and Rotation.
UFCFX5-15-3Mobile Device Development Particle Systems.
GameCamp! and Game Davis Creating a 2D Platformer in Unity.
Done already for your convenience! Telerik School Academy Unity 2D Game Development.
Collision Detection Michael Fuller. Overlap testing Most Common Technique Most Error Prone Test if two bodies overlap.
UFCEKU-20-3Web Games Programming Unity 3D Physics Colliders and Object Collisions.
SOURCE 2006 Presentation by Luke Arntson Game Programming Optimization.
Collision and Animation Systems in Games Jani Kajala Lead Programmer / Chief Technology Officer, Pixelgene Ltd (0)
Unity Lecture Unity Build-in Physics Engine. Unity contains powerful 3D physics engine NVIDIA PhysX Physics. Create immersive and visceral scenes with.
Backgrounds, Inheritance in GameMaker (BrickMania 1 of 2) Foundations of Interactive Game Design Professor Jim Whitehead January 28, 2008 Creative Commons.
By Mr. Lee. Backgrounds The image that appears in the background (duh!). This might be a horizon, or clouds, trees and rainbows in the distance If you’re.
A Spring 2005 CS 426 Senior Project By Group 15 John Studebaker, Justin Gerthoffer, David Colborne CSE Dept., University of Nevada, Reno Advisors (CSE.
CSE 381 – Advanced Game Programming Quickhull and GJK.
SE 350 – Programming Games Lecture 7: Programming with Unity Lecturer: Gazihan Alankuş Please look at the last slide for assignments (marked with TODO)
Web Games Programming An Introduction to Unity 3D.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
UFCFS D Technologies for the Web Unity 3D: Review of Topics and Related Concepts.
Sample Video Game & Sound. The Plan 1.Game Theme 2.Game Structure 3.Sprites 4.Trackers 5.Collisions 6.Score 7.Levels 8.Splash Screens 9.Design 10.Implementation.
SE 320 – Introduction to Game Development Lecture 3: Unity’s Interface and Concepts Lecturer: Gazihan Alankuş Please look at the last two slides for assignments.
SE 320 – Introduction to Game Development Lecture 7: Programming Lecturer: Gazihan Alankuş Please look at the last two slides for assignments (marked with.
Game Maker – Getting Started What is Game Maker?.
UFCEK-20-3Web Games Programming Unity 3D: Review of Topics Publishing for the Web.
Fundamentals of Level Editor Design and Implementation.
ENGR-TS-2: The students will develop an understanding of how the design process is used to develop a technological system.
Unity3D Physics April 3, 2015 Comp Game Design Michael Shah.
Computer Game Design and Development
Derived from Kirill Muzykov’s Rocket Mouse Tutorial WakeUpAndCode.com.
UFCFSU-30-13D Technologies for the Web An Introduction to Unity 3D.
 How can we find/refer to objects at runtime?  This must be dynamic because objects may come and go.  How can we solve this problem?
Yingcai Xiao Game Development with Unity3D Inside/Outside Unity3D.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Chapter 14 Part 1: Core Game Mechanics By Nolan Driessen.
Behavior trees & The C# programming language for Java programmers
Game Development with Unity3D
Quick Intro to Unity Lecture 2.
Collision Theory and Logic
Game Development with Unity3D Inside/Outside Unity3D
Done already for your convenience!
3GB3 Game Design Unity 3D Basics.
Unity3D for Mobile Sprites, Camera, Physics
Unity 2D: Step by Step, Part 4
Collision Theory and Logic
Background Shapes & Collision Resolution (Top-down and Side-scrolling)
Collision Detection Box-to-Box.
Projectiles in Unreal Engine 4
TECHNICAL POSTER Laser reactant objects Interactive Doors and Saving
Collision Detection, Prefabs
lecture 8 Our First Project
Lecture 3 Richard Gesick
Creating & Using Sprites Adding Colliders
Player preferences, Loading Scenes, Activating and Enabling
Week 6: Time and triggers!
Fundaments of Game Design
Fundaments of Game Design
Fundaments of Game Design
Software design and architecture
Fundaments of Game Design
Fundaments of Game Design
Fundaments of Game Design
Chapter 14 Part 1: Core Game Mechanics By Nolan Driessen
CO Games Concepts Week 12 Collision Detection
GETTING OUT OF THE BOX.
Games Development Game Architecture: Entities
Unity Game Development
Java Concurrency 29-May-19.
Unity Game Development
A Gentle Introduction to Unity 2D Game Programming
Presentation transcript:

Fundaments of Game Design Unity colliders and triggers Richard Gesick

Objectives Unity colliders Unity triggers OnTrigger OnCollision Destroying game objects

Colliders A collider is a component that can be added to a game object Collider components define the shape of an object for the purposes of physical collisions. A collider, which is invisible, need not be the exact same shape as the object’s mesh and in fact, a rough approximation is often more efficient and indistinguishable in gameplay. The simplest (and least processor-intensive) colliders are the so-called primitive collider types. In 3D, these are the Box Collider , Sphere Collider and Capsule Collider. In 2D, you can use the Box Collider 2D and Circle Collider 2D. Any number of these can be added to a single object to create compound colliders.

Colliders (2) With careful positioning and sizing, compound colliders can often approximate the shape of an object quite well while keeping a low processor overhead. There are some cases, where compound colliders are not accurate enough. In 3D, you can use Mesh Colliders to match the shape of the object’s mesh exactly. These colliders are much more processor-intensive than primitive types, however, so use them sparingly to maintain good performance.

Colliders (3) Colliders can be added to an object without a Rigidbody component to create floors, walls and other motionless elements of a scene. These are referred to as static colliders. Colliders on an object that does have a Rigidbody are known as dynamic colliders. Static colliders can interact with dynamic colliders but since they don’t have a Rigidbody, they will not move in response to collisions.

Triggers The scripting system can detect when collisions occur and initiate actions using the OnCollisionEnter function. You can also use the physics engine simply to detect when one collider enters the space of another without creating a collision. A collider configured as a Trigger (using the Is Trigger property) does not behave as a solid object and will simply allow other colliders to pass through. When a collider enters its space, a trigger will call the OnTriggerEnter function on the trigger object’s scripts

Collisions OnCollisionEnter(Collision col) OnTriggerEnter(Collider col) When collisions occur, the physics engine calls functions with specific names on any scripts attached to the objects involved. You can place any code you like in these functions to respond to the collision event

OnTrigger sample private void OnTriggerEnter(Collider other) { if (this.tag=="Finish" && other.tag == "Player") go.SetActive(false); if(go2!=null) go2.SetActive(false); win = true; } if (this.tag=="Respawn" && other.tag=="Player") go.transform.position = startPos; go.GetComponent<Rigidbody>().Sleep(); . . .

Destroying game objects The first instinct of many programmers is when a bullet hits an enemy or an enemy hits a player to destroy the object or objects. You need to carefully consider that event. Why? Consider a camera that is a child of a player. What happens when the player is destroyed? In some cases it is better to use player.SetActive(false);