Scripting Questions

3

Let’s say I have a coroutine which waits for the player to login. The function EndLoginSequence is subscribed to an event OnEndLogin. This code works just fine, but I was wondering if there’s a way to...
Instate asked 22/10, 2012 at 8:7

3

I don’t want to use the "Additive Particle" shader with my line. I want a solid color instead of the transparency. The problem is that whenever I use diffuse and try to set the color through LineRende...
Manifestation asked 12/7, 2013 at 3:11

2

Hey guys, I have a single Object which has an Audio Source due to only wanting a single audio to play at a time. Besides that i have various interactables which can be clicked in order to play a sound...
Climactic asked 1/9, 2020 at 12:24

1

I’m trying to create nested ScriptableObjects. So far I can add a child ScriptableObject to a parent object using AssetDatabase.AddObjectToAsset which is good. However, attempting to add a sub child o...
Interdental asked 22/7, 2020 at 10:22

6

Solved

I am making a fps shooter and I need my enemy to follow me when I am with in a certain range of the enemy this is what I have so far. using System.Collections; using System.Collections.Generic; using ...
Lilia asked 10/5, 2020 at 21:26

1

Solved

Hello, I have a game where I want the heightmap of the terrrain to be changed at runtime by the player, but I cannot get that to work. I have multiple .raw files in the project already that are waitin...
Syllabism asked 9/9, 2016 at 10:37

3

I’ve done a basic ParticleSystem tutorial on YT, wich plaus well in the editor. But for some reason I can’t get to start the animation from my Script. This might come from Visual Studio that crushes t...

5

Solved

I am having problems with Scriptable Objects in my game. I made a single completely unrelated change at one point and all of the Scriptable Objects became corrupt. When clicking on the Scriptable Obje...
Noonan asked 24/11, 2017 at 23:43

3

I have a system where I have objects load up visually before they become usable in the game. As each object potentially has numerous scripts that can affect it or the system, I do this code: var compo...
Broad asked 31/5, 2018 at 14:12

3

Hello. I am new at c# and unity. The problem that im facing is ; I created such a script to destroy prefab instances(they are moving towards an axis and when they arrive a Z value I aim to destroy the...
Roberts asked 1/6, 2019 at 11:20

2

Solved

I am creating a project in which a part of an image can be erased with a mouse click/drag. I have already made the mouse click. However, when the mouse is dragged quickly, there are gaps between the e...
Jugal asked 27/8, 2018 at 7:43

3

I want to change a decimal variables in runtime in the inspector or just watch it without using Debug.Log(variable); Is this anyhow possible?
Ting asked 13/10, 2014 at 14:53

1

My game use 2d physic, but 3D graphics. The unity editor automatically generates a collider polygon using the sprite of the desired shape. If for example on a sprite a circle is drawn on a transparent...
Crosby asked 23/3, 2018 at 14:28

2

i just started to get into mobile inputs. i’ve learned to check if I’m touching the UI or not but I can’t find how could I get it so I know what UI element I actually are touching (ex. image, text…).
Jaques asked 20/9, 2020 at 15:59

2

I have an animation and have this script on that gameobject. It will play sound at certain points during my animation, using the animation event function. It works great! however, I would like more th...
Tran asked 12/9, 2015 at 19:14

2

Solved

I have Unity Pro and I’m using the Water4Advanced Example they give you. How can I make it where when my player goes under water the screen has a little blue effect and where gravity lowers? I’ve hear...
Ontogeny asked 28/10, 2011 at 0:55

2

Good day. I have a script with DontDestroyOnLoad property. I need to run one method when one scene in particular is loaded. Its clear i need to check for the activeScene , but I don’t know how to trig...
Fivepenny asked 6/10, 2018 at 13:9

4

Suppose you have a set of coordinates on a 3D plane forming a polygon. I want to convert this 3d polygon into a 2d polygon with same lengths. How do I go about this? Are there any methods in unity tha...
Induce asked 27/6, 2018 at 8:24

6

Hey guys, i doing some itens for my game make the development easer, i wish add custom icons to my itens, which are ScriptableObjects, how i can do this? i know the trick of put the icon on Gizmo fold...
Conley asked 10/1, 2018 at 16:52

2

I’m fairly new to unity, so I’d like to apologize if this question sounds stupid. I’m trying to make pac-man in 3D as my first unity project and things have been going really smooth. (I’m almost done,...
Doorplate asked 18/6, 2023 at 19:30

7

Solved

I know how to do that with tags, but in my case I would need to use layers since I’m already using tags for other purposes on those objects. Is there a way to return the amount of objects in a specifi...
Whalebone asked 23/10, 2011 at 19:14

2

I have a box with script BoxScript on it. BoxScript looks like this: void Update () { float fdegree = RadianToDegree( transform.rotation.y ); Debug.Log( fdegree ); } float RadianToDegree ( float an...
Kephart asked 12/12, 2012 at 3:14

6

Solved

Inside ScrollRect I have UI elements with Monobehaviour scripts which implement OnPointerDown() and OnPointerUp() methods. OnPointerDown() locks scrolling and OnPointerUp() unlocks it. OnPointerDown()...
Acquire asked 15/10, 2015 at 7:17

2

I want make simple lowpoly procedural generation floating island in Unity, like this: 163640-island-sky-min.png1920×1080 170 KB I decided to make a simple sphere then I flattened the top and randomly ...
Smarmy asked 19/7, 2020 at 1:46

4

Solved

I tried limiting a Vector3 with Mathf.Clamp, but it caused a jittery effect on the gameobject. Note: This is not C# but now obsolete (JS-like) Unity Script. public var moveSpeed : float; public var mi...
Teasel asked 31/12, 2012 at 5:8

© 2022 - 2025 — McMap. All rights reserved.