unity gizmo draw line
C#
using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour
{
public Transform target; void OnDrawGizmosSelected()
{
if (target != null)
{
// Draws a blue line from this transform to the target
Gizmos.color = Color.blue;
Gizmos.DrawLine(transform.position, target.position);
}
}
}
// you need the LineRenderer component in your object
var line = gameObject.AddComponent<LineRenderer>();
line.SetPosition(0, startingPoint);
line.SetPosition(1, middlePoint);
line.SetPosition(2, endPoint);
Also in C#:
- Title
- repeater itemdatabound event in c#
- Category
- C#
- Title
- what does gameobject.find return
- Category
- C#
- Title
- c# get list of all class fields
- Category
- C#
- Title
- c# iterate over string
- Category
- C#
- Title
- get set c#
- Category
- C#
- Title
- c# max two values
- Category
- C#
- Title
- how to print statement in c#
- Category
- C#
- Title
- unity monobehaviour
- Category
- C#
- Title
- c# get gridview DataKeyNames
- Category
- C#
- Title
- Move player on planets in unity 2d
- Category
- C#
- Title
- use enter key unity
- Category
- C#
- Title
- unity 2d platformer movement script c#
- Category
- C#
- Title
- c# convert list to string
- Category
- C#
- Title
- c# remove last value from list
- Category
- C#
- Title
- c# remove character from string at index
- Category
- C#
- Title
- sum of digits in c#
- Category
- C#
- Title
- c# getasync response
- Category
- C#
- Title
- matplotlib measure the width of text
- Category
- C#
- Title
- change partial view based on select asp.net core
- Category
- C#
- Title
- c# combobox datasource enum
- Category
- C#
- Title
- unity rigid body variable
- Category
- C#
- Title
- application variable in asp.net core
- Category
- C#
- Title
- No context type was found in the assembly
- Category
- C#
- Title
- unity input get axis
- Category
- C#
- Title
- unity check when clicked on object
- Category
- C#
- Title
- autoresetevent
- Category
- C#
- Title
- escape double quotes c#
- Category
- C#
- Title
- unity onclick addlistener
- Category
- C#
- Title
- resize image c#
- Category
- C#
- Title
- decalre an int list mvc
- Category
- C#
- Title
- c# find duplicates in list of strings
- Category
- C#
- Title
- how to reduce garbage collection c#
- Category
- C#
- Title
- how to stop window from terminating c# visual studio
- Category
- C#
- Title
- movement script c#
- Category
- C#
- Title
- take screenshot in c#
- Category
- C#
- Title
- c# reflection create generic type
- Category
- C#
- Title
- how to create a variable in C#
- Category
- C#
- Title
- get enum by index c#
- Category
- C#
- Title
- unity get component
- Category
- C#
- Title
- Check object is in layermask unity
- Category
- C#
- Title
- bold caption latex
- Category
- C#
- Title
- c# public static string
- Category
- C#
- Title
- c# instantiate
- Category
- C#
- Title
- unity c# get bool from another script
- Category
- C#
- Title
- c# generate random number
- Category
- C#
- Title
- c# for loop without increment
- Category
- C#
- Title
- unity check if gameobject is active
- Category
- C#
- Title
- how to exit a program in c#
- Category
- C#
- Title
- c# null conditional operator if statement
- Category
- C#
- Title
- how to get the last element in an array in c#
- Category
- C#
- Title
- c# catch two exceptions in one block
- Category
- C#
- Title
- find month number from date C#
- Category
- C#
- Title
- how to convert string to bool c#
- Category
- C#
- Title
- how to cast list to observablecollection c#
- Category
- C#
- Title
- how to disable a gameObject unity c#
- Category
- C#
- Title
- unity material offset script
- Category
- C#
- Title
- javascript append
- Category
- C#
- Title
- c sharp if string equals
- Category
- C#
- Title
- mvc c# w3schools
- Category
- C#
- Title
- c# random number between 0 and 1
- Category
- C#
- Title
- show double in textbox c#
- Category
- C#
- Title
- c# create a text file
- Category
- C#
- Title
- c# move with arrow keys
- Category
- C#
- Title
- c# read a webpage data
- Category
- C#
- Title
- rotate player unity
- Category
- C#
- Title
- percentage in c#
- Category
- C#
- Title
- in unity i want to destroy a gameobject when it hits the edge of the screen
- Category
- C#
- Title
- no overload for 'useItemOnSceneLoad' matches delegate 'UnityAction<Scene, LoadSceneMode>'
- Category
- C#
- Title
- c# list append
- Category
- C#
- Title
- how to put double quotes in a string c#
- Category
- C#
- Title
- The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.
- Category
- C#
- Title
- unity gameobjects with tag
- Category
- C#
- Title
- how to make % posibility to spawn an object C# in unity
- Category
- C#
- Title
- unity string format time
- Category
- C#
- Title
- how to store some variables on the device in unity
- Category
- C#
- Title
- radians to degree c#
- Category
- C#
- Title
- how to clear console through script unity
- Category
- C#
- Title
- object escape player unity
- Category
- C#
- Title
- unity load next scene
- Category
- C#
- Title
- c# arraylist
- Category
- C#
- Title
- c# empty char
- Category
- C#
- Title
- unity custom editor save changes
- Category
- C#
- Title
- asp net identity include phone number when registering
- Category
- C#
- Title
- c# get foreground window
- Category
- C#
- Title
- dynamic convert type c#
- Category
- C#
- Title
- Unity if object doens't exist
- Category
- C#
- Title
- c# implement ienumerable t
- Category
- C#
- Title
- unity oncollisionenter2d
- Category
- C#
- Title
- pop up element from specific index in array
- Category
- C#
- Title
- how to open new form on button click in c# xamarin
- Category
- C#
- Title
- how to draw a dot in c#
- Category
- C#
- Title
- check if string is email c#
- Category
- C#
- Title
- native-googlesignin configuration is null!?
- Category
- C#
- Title
- copy a list C#
- Category
- C#
- Title
- c# push numbers to array
- Category
- C#
- Title
- unity set list of strings
- Category
- C#
- Title
- get type of variable c#
- Category
- C#
- Title
- asp.net model display name
- Category
- C#
- Title
- how to stop a form c#
- Category
- C#
- Title
- toggle unity c#
- Category
- C#