Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
DMD2542/DMD_Stock_Ticker/Assets/Scripts/Nozzle.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16 lines (14 sloc)
495 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| |
using UnityEngine; | |
using System.Collections; | |
public class Nozzle : MonoBehaviour { | |
// Creates pixels at nozzles position | |
public void SpawnPixel(GameObject pixelPrefab){ | |
//create GameObject pixel; | |
GameObject pxl; | |
//set variable new pixel object | |
pxl = (GameObject)Instantiate (pixelPrefab, transform.position, transform.rotation); | |
//push object using Rigidbody Component | |
pxl.GetComponent<Rigidbody>().AddForce (new Vector3(10000.0f, 0.0f, 0.0f), ForceMode.VelocityChange); | |
} | |
} |