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 (1)

0
votes
1answer
129 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
60 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
87 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
19 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
33 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
56 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
36 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
51 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
22 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 ...
0
votes
2answers
42 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
460 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
43 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
24 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
27 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
39 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
64 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
43 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
57 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
27 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
84 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
30 views

Sprite cut in half after placed on Scene

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
37 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
32 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
32 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
62 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
76 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 ...
0
votes
1answer
58 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
55 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
29 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
2answers
84 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
36 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 ...
1
vote
0answers
45 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
53 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 ...
0
votes
2answers
43 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
132 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
57 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 = ...
-1
votes
1answer
116 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
26 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
50 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
48 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
37 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 ...
17
votes
3answers
1k 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 ...
0
votes
1answer
26 views

Inline If failing to update variable value

So, I have a toggle button to change a bool value, in this script 't1Bool'. The toggle button is working because when I use a Debug.log I can see the value changing from true o false when I press the ...
0
votes
3answers
58 views

Text independent of screen resolution in Unity? [closed]

I have the following code that depends on the resolution of the user's display: void OnGUI() { GUI.Label(new Rect(432, 525, 9000, 9000), ("Hello!")); } And of course, the location of the text ...
6
votes
2answers
446 views

Making holes in 3D objects (Unity)

How can I make a hole in an object with Unity 3D? I've something like this object and I want to make a hole in it.
1
vote
3answers
51 views

Nothing happens when I press play in Unity3D

Hello everyone I am making my first game, things were going well but suddenly nothing happens when I press play, I have already update to the newest unity version but it persists. I have the main ...
0
votes
0answers
33 views

How can I change my angular momentum correctly using Unity3d physics?

This is an odd question to ask here, but I've almost been pulling my hair out trying to solve this. Plus its more of a mathematical/physics problem than a programming one. I'm trying to implement ...
0
votes
1answer
53 views

What is the most efficient method of creating a detailed 3d tileset in a 3d game that uses a grid? [closed]

Well, the most efficient method might be with how minecraft does the terrain by using a single block for a single grid, but one thing I am concerned about is that the method minecraft uses is poorly ...
0
votes
1answer
77 views

How do I hide UI canvas in c# Unity3d?

I want to display the final results at last in the game when gameobjects finish the winning(finish) line. For that I am using canvas and in that a panel onto which an image is attached. I have to hide ...