Unity is a cross-platform game creation system that focuses on easy art pipeline process. It consists of a game engine and an integrated development environment. The game engine's scripting is built on Mono.

learn more… | top users | synonyms (2)

0
votes
0answers
54 views

Unity: Bypass Ctrl+S in a custom Editor Window

Is there a way to bypass Ctrl + S for Windows or ⌘ + S for Apple default behaviour (save scene) in a custom editor window?
0
votes
1answer
104 views

Click event doesn't trigger when clicking

I've made some buttons on my screen to navigate to other scenes of my Unity project but the Click(string command) method doesn't trigger. I've placed a breakpoint on the bold line in code below, but ...
0
votes
1answer
323 views

Shader change alpha depending on light

I use Unity, and I need a shader a bit special. Unfortunatly my skills about shaders are very limited and I need this shader quickly. So I want a shader to display a unlit texture on a plane, and ...
0
votes
0answers
98 views

How do i disable inherent scaling of bone joints in Unity?

Is there a way to disable inherent joint scaling in unity? In other words, stopping child joints from inheriting multiple scales from each bone higher on the hierarchy. Basically I want each joint to ...
0
votes
0answers
15 views

How to scale a bush mesh to 4 when it can only be scaled to 2 in the tree editor in unity

I had bought a unity asset (Yughes pines bushes v2) and the scale of the bushes is too small and so i put the scale to 4 and when i add the bush as a tree in the terrain editor it can only scale to 2,...
3
votes
2answers
2k views

Why doesn't my C#6 code compile in Unity?

Why can't Unity work with C# 6 code? It always gives me compiler errors. Here are some code examples: using static System.Convert; using static System.Environment; $"€{punten}{NewLine}€{Money}{...
0
votes
0answers
106 views

Singleplayer and multiplayer using same gameobjects in Unity?

There are a lot of topics about converting singleplayer to multiplayer games. But I could not find the accepted practice of keeping singleplayer gameplay available. Will this just work if I manually ...
0
votes
1answer
172 views

Continuous Jumping Cycle

The script makes a GameObject jump using realistic gravity and reach a specific target. The GameObject jumps relative to the target, thus adjusting its trajectory. It also works while the target point ...
0
votes
3answers
137 views

Show 3D elements on 2D background

I'll make a navigation menu in my game and had the good idee to this the enemies to start games or go to the gun store. The problem is when I look in game mode, the enemy named ZomBear in hierarchy ...
0
votes
1answer
185 views

Unity Singleton accross multiple scenes

I have a game where my code is designed to be on a single scene so I've implemented a singleton like that: public class MonoSingleton<T> : MonoBehaviour where T : MonoBehaviour { private static ...
0
votes
0answers
40 views

Difference between sprite and texture? [duplicate]

Can you please explain the difference between texture and sprite? When we zoom in a sprite, it appears blurry because it's basically an image. Is it the same for a texture? I read this comment on the ...
0
votes
1answer
31 views

Unity web player API?

Just curious about it. I only want to know that what graphics API does the Unity web player uses. Is that WEBGL? Or simply OPENGL? Or A custom one? Then how do the games get gpu acceleration?
0
votes
1answer
221 views

Sending message to all players in room from Photon server?

I need to send a message to all players in the room from a Photon server. Sending the message from a player would introduce too much latency so I need the server to collect data and distribute ...
1
vote
1answer
114 views

How do I snap the Unity camera to a 2D, tile-based map?

I have a 2D, tile-based map. I want to be able to control the number of visible tiles on the screen vertically and horizontally, regardless of resolution. I want the player to be able to move the ...
0
votes
1answer
39 views

Why does transform.forward appear to be void?

I have the following line of code from a project I'm working on: this.transform.position += (keyMapping.Value * this.movementSpeed).Scale(this.transform.forward); At a first glance, this line of ...
1
vote
1answer
122 views

Making a Fall Trigger Game Over

I have been struggling with this fairly basic issue: To make a game over menu appear upon death. I am making a 3D game in Unity, where you, the player, must control a sphere with the basic controls: ...
0
votes
0answers
40 views

Only one side of the object reflects light while in the shadow

in my scene I have a plane as a floor and a plane as a building next to it, my directional light is rotated to make the building cast shadow on the road. I placed a few cubes on the road, the building'...
0
votes
2answers
92 views

Positioning 2D (non-UI system) game objects

As an old Flash dev I'm slightly confused about how you position game objects on the screen in Unity since game objects have no width or height (only a scale). Let's say I have a container gameobject ...
3
votes
2answers
2k views

Most efficient way to convert Vector3 to Vector2

What is the most efficient and fastest way to convert a Vector3 to a Vector2? Casting: Vector2 vector2 = (Vector2)vector3; Initailizing a new Vector2: Vector2 vector2 = new Vector2(vector3.x, ...
0
votes
1answer
59 views

The best way to pass data between clients in a room

I am developing a backgammon game in Unity and tried to use Photon. But I could not find a step by step help for it and I also know that photon in real-time and it syncs data over 10 times per second. ...
0
votes
0answers
32 views

Shader - Directional Lights Depth

Is there a way to retrieve the deph from directional lights ? I can access the _ShadowMapTexture but this is not the depth. I found how to access the shadow map of, I think, every light type by using ...
0
votes
0answers
130 views

Culling And Optimization in a 2D Orthographic Game

I'm currently developing a 2D top-down space themed RTS game. I'm building the space procedurally from a seed. At the end of generation of all space objects, if i don't apply any optimizations I end ...
0
votes
2answers
64 views

Code Logic's execution with respect to time Events

I have to show complete 24 hours cycle in Unity3d Scene. Where different kind of task will be executed in different Times. Suppose at 2pm I have to move a car, at 6pm An Aeroplane will land on ...
5
votes
1answer
108 views

Calculate edge loop from plane intersection

This is a fairly complex question, so please bear with me. I'm attempting to calculate an edge loop based on the intersection of a plane with a mesh, bounded by a sphere. Here is a mockup of what ...
1
vote
1answer
46 views

Getting help on collaboration with Unity especially programmers

My team and I are currently creating a 3D tower defense game with Unity and are compromised of me a few animators modelers and programmers. However as I am still fairly new to Unity I have trouble ...
0
votes
2answers
362 views

How to destroy object after animation

I've made an object and when the player has pick it up, rise it up and stop it out of screen. But because you can see the shadow of that object, I will destroy it after the animation has played. But ...
1
vote
2answers
31 views

How to call a method after a yield instruction in the same frame?

When I run this script... int frameCount; void Start() { frameCount = 0; StartCoroutine(first()); } void Update() { frameCount++; Debug.Log("Frame " + frameCount); } public ...
-2
votes
1answer
105 views

good and free 3D modeling programs for implement into Unity [closed]

I'll make some objects that are not easy to make in Unity, but on my previous question Making holes in 3D objects (Unity) was there an answer that said that I can make it whit an other 3D modeling ...
0
votes
1answer
86 views

Sprite cut in half after placed on Scene [duplicate]

I have noticed a very odd behaviour in Unity 5.2.1. When I drag and drop a Sprite into the Scene, it's cut in half like this: I tried with PNG and PSD formats but it didn't help. Although when I ...
0
votes
2answers
47 views

Mouse input position is being printed as Unity coordinates, but the actual coordinates used seem incorrect

This will be hard to explain, but I'll try to keep it short and simple: I'm trying to set the position of a UI rectangle to the position of the mouse when clicked. When initialized, the position of ...
0
votes
1answer
53 views

Unity - Access to svPosition in fragment shader

I am trying to access to the svPosition in my fragment program in Unity but I keep having this error. invalid input semantic 'POSITION': Legal indices are in [1,15] invalid ps_3_0 input semantic '...
0
votes
0answers
53 views

Interpolating positions between FixedUpdate frames in Unity?

Lockstep Framework uses FixedUpdate () in Unity to match an assumed fixed timestep. At higher rates, FixedUpdate doesn't at all run at a fixed rate but instead runs multiple times in a single frame to ...
1
vote
1answer
283 views

Configurable Joint, linear limit range

I am working on a physics driven pressable button, but I cannot seem to tackle the minimum and maximum limits. This is the rig I have set up for the button (as it looks when pressed down). 2D view: ...
0
votes
1answer
495 views

What does EventSystem.currentSelectedGameObject consider the current object to be?

I've been working with UI in my project as of late and I can't figure out what Unity's event system is supposed to return for currentSelectedGameObject. if (EventSystem.current....
0
votes
1answer
213 views

Change key setting from qwerty to azerty in Unity

How can I change the default key for walk with the player in Unity. For this moment I can do this whit A, W, D and S (or something). But because I work whit an azerty keyboard, I'll change it to Z, Q, ...
0
votes
1answer
129 views

2d raycast collision problem

I am currently making a 2d top down game in unity and have stumbled upon a problem with my raycast collision. I want my green player to stop moving when colliding with a wall, therefore i made my ...
1
vote
1answer
79 views

Unable to move mouse cursor while pressing keyboard button

I've a player to which I've attached character controller and two scripts - Controller and MouseLooker to control the player movements but when I try to move my mouse cursor while pressing keyboard ...
0
votes
3answers
293 views

How to check if a game object is inside another gameobject

My idea is that there is a plane which is more of a border at top of the screen and if a game object has no more space to fall and it collides with something while it is in that border, the game ends. ...
0
votes
2answers
96 views

Play two different audio sources depended on code behind

How can I play two different audio clips in Unity depended on the code behind? Into my object I've added two audio sources namely 'Player GunShot' and 'outOfAmmo'. Into the same object I've also ...
2
votes
0answers
101 views

Subsurface Scattering - Transmittance

I have a question related to SSS and especially transmittance. I've looked at several papers about that topic, most of them from Jorge Jimenez, which are very interesting and, I admit, a bit hard for ...
1
vote
1answer
206 views

How to add & copy particlesystem attached to an existing gameobject uisng c# script in unity?

I've a game object "FireBall" there is a particlesystem attached to it . I want to add the same particlesystem to other gameobject "Avatar" . Initially there is no particlesystem attached to "Avatar"....
0
votes
2answers
55 views

Cannot detect input in void OnCollisionEnter()

Code: void OnCollisionEnter() { if (Input.GetMouseButton(0)) { // do something } } Of course, this code does not work. What I intend to do: "After collision, if the ...
0
votes
1answer
377 views

Unity 3D error when compiling to WebGL: Destination directory not found

When I try to compile my Unity project to WebGL in Development mode on Windows 8.1 (and with the latest version of Unity), I receive the following errors (the first one is truncated because it's ...
0
votes
1answer
299 views

How to set material to gameobject dynamically using c# script in unity?

I want to set material to a gameobject in unity using c# script. I am using this code to set the material of mesh renderer attached to the gameobject - MeshRenderer mesh = gameObject.GetComponent<...
-1
votes
1answer
156 views

How to create a minecraft style world that is based of a heightmap

for my game I am trying to create a minecraft style world that is based of a heightmap that I made In photoshop. I am trying to make the map like 7km and 1 cube is 1m. but i haven't found a way to do ...
0
votes
1answer
52 views

Generate objects on playground on random location

How can I generate an object on my play ground? Note that there are some locations where the new generated item can't be placed. (Click on image to see the real size) I was following a tutorial on ...
-2
votes
2answers
69 views

Randomly changing game scenes in unity c# [closed]

Is there any way that I can randomly change scenes in Unity C# using arrays?
0
votes
1answer
142 views

Copy a gameObject's collider at runtime (Unity)

I'm working on a small Unity 2D project in which I need to modify the collider of the player at runtime. I'm using Physics2D.Raycast to find the collider and then what I'd like to be able to do is ...
0
votes
0answers
72 views

How to apply 2D LUT on image/video?

I would like to apply colour correction to image or video using LUT. The LUT correction script thats available in standard assets works with camera only. Would like to know how to apply LUT ...
18
votes
3answers
2k views

Saving player's progress in a Unity game

I am making a game using the Unity game engine. I want to save the player's progress including level, experience points, chosen character, etc. Presently I am using playerprefs but I want to know ...