Refers to 5-th edition of Unity Engine, released in March 2015, featuring their new Standard Shader. It uses PhysX 3.3 and has many other upgrades over it's predecessor.
0
votes
1answer
11 views
Get enum value “string”, and get int value of that
Sorry if the title is confusing, but I literally don't even know how to summarise this into a title. So here's the problem:
I have a list of combat moves for a character. I have an animation for each ...
1
vote
0answers
12 views
Unity Teleport Script issue
I wrote this script quickly just for moving across my map for testing purposes. I created a prefab with this script on it and gave it the Destination GameObject which works fine, it teleports me as ...
0
votes
1answer
21 views
Select all components of certain type in the children Game Objects
I would like to set programatically the material on a Game Object. The problem is that it has several Child Objects, which many have their own sprite.
I came up with this...
foreach(Transform ...
0
votes
0answers
34 views
How to convert this Game Jolt API call from C# to JavaScript? [on hold]
In the Gamejolt API Documentation
The trophy.Unlocked in
C#
var trophyID = 26534;
GameJolt.API.Trophies.Get(trophyID, (GameJolt.API.Objects.Trophy trophy) => {
if (trophy != null)
{
...
-1
votes
0answers
18 views
Unity syntax highlighting with VSCode
I'm using VSCode, not VisualStudio for Unity scripting. VSCode has syntax highlighting for C#, which works fine, but all the Unity related stuff like Vector3 doesn't get any highlights. I know, that ...
-1
votes
2answers
38 views
What is the difference between getting a reference and creating a new instance of an object? [on hold]
I asked a question a while ago and got an answer that I can either get a reference to the object or create a new one, like the below example:
Example myExample = get some reference to the ...
1
vote
1answer
34 views
Calculate average of arbitrary amount of quaternions (recursion)
Simply calculate the average for 2 Quaternions should work like follows right? :
Quaternion.Lerp(rotationlist[0].transform.rotation, rotationlist[1].transform.rotation, 0.5f);
And now I tried to ...
0
votes
1answer
37 views
How do I access variables using namespaces?
I've got a whole lot of scripts, none of them so far use namespaces. But as I get more and more scripts to deal with I thought it would be a wise idea to start using namespaces. I've never used them ...
0
votes
2answers
30 views
Unity 2D Following player on the x-axis only, at a constant speed
This following code does work, but I have one issue with it. Once the gameobject starts getting close to the player that it is chasing it slows down and does not continue going at a constant speed to ...
1
vote
1answer
13 views
How to get the GameObject's LayerMask?
I am currently following Unity's 2D Roguelike tutorial.
In that tutorial, I have Player, Enemy, and Wall Prefabs, which all belong to a Layer called BlockingLayer.
The Player and Enemy Prefabs both ...
0
votes
0answers
13 views
Physics2D lag on increased timescale Unity
I have been working on an infinite runner kind of game in which i am trying to implement a speedup powerup kind of thing . Something that will allow me to boost through the levels at a high speed
I ...
0
votes
0answers
13 views
Draw 2D sprite the same size regardless of distance from perspective camera
I have gameObjects which have 2D sprites, of which are scattered through out my game world. These are all rendered in a perspective camera.
Now currently i am zooming the perspective camera in by ...
0
votes
0answers
14 views
Effect of merging sprite
I want to create the effect of merging of colours if they are overlapping.
My game is a tile-based game. For all intents and purposes, lets consider a tile from (0,0) to (1,1) in the entire example.
...
-1
votes
1answer
33 views
Game Development Unity3D Free or Paid level?
I am going to develop an iOS/Android game. I want to choose a TOOL to start game development.
I went thought Unity 3D. I read its not free. I also read that we need to pay them for getting native ...
0
votes
0answers
15 views
Unity Compute Resource Management
I have a n open ticket with unity about some code I have that uses the GPU to generate quads and passes them to an array on the cpu.
The code in question is a little specific to my situation so I ...
1
vote
1answer
34 views
How do I call the sprite auto-slicer from a script in the Unity editor
First of all let me start with an apology. I know this may not be the right place for this question, but the good people over at stackoverflow did not answer me and neither did I get a answer over at ...
0
votes
1answer
20 views
Unity 3D Move Object with RigidBody
I have added RigidBody component as well as Mesh collider to an object moved with keyboard. I know that it the object will go through another (with RigidBody and Mesh collider too) if I use transform ...
1
vote
2answers
26 views
Unity get more than 2 lines of log height
Unity does only display 2 lines in height for each log, at least with the default settings. I couldn't find a menu, where I could change this.
I want to display a matrix, and I need to see the log ...
0
votes
0answers
19 views
Unity websocketsharp is closing the connection directly
I got a working code, which I want to change a bit for better readability but afterwards my web socket is just closing instantly.
First off, I got this code working :
using UnityEngine;
using ...
1
vote
1answer
28 views
Unity simple solid color alpha shader
I searched for a shader, where I can set a solid color, which I can fade in or out like I want. There is not such a thing build in as far as I could see. Now I got this code, which works fine in case ...
0
votes
0answers
16 views
how can I orbit camera around object by touch position?
this Is basic code "Mouse Orbit" and correctly work on windows platform but In android we need touch position.
using UnityEngine;
using System.Collections;
[AddComponentMenu("Camera-Control/Mouse ...
-2
votes
0answers
21 views
Error 'ArgumentException:The thing you want to instantiate is null' when creating a game object [closed]
I am creating a game object using C# script in the following way:
using UnityEngine;
using System.Collections;
public class TestingPositions : MonoBehaviour {
GameObject hero;
Sprite ...
0
votes
0answers
35 views
Why does my Point light turn off if Player walks in any direction in Unity 2D?
My 2D Sprite has a material, Sprite diffuse attached to it.
Now when I set up a light, it works but if I play the Game and walk, the light turns off immediately and the Player turns black.
The ...
3
votes
0answers
30 views
Displaying text on a 3D plane
I am busy with a pet project where I am trying to create a Collectible Card Game in 3D.
These cards have Hp and Damage etc. but I cannot find a way to neatly display these values.
I tried to use a ...
0
votes
1answer
69 views
Simple 2.5D flight movement
I'm building a simple 2.5D Dogfighting game, kinda similar like this one: https://gfycat.com/PleasantDeterminedArcherfish for the moment my movement works like this:
if (Input.GetKey("left"))
...
0
votes
0answers
31 views
Unity material.color not changing color
I'm trying to change a material color programmatically using this line of code:
ringObj.GetComponent<Renderer>().material.color = new ...
0
votes
1answer
26 views
PS3 controller with Unity on Mac
I am trying to use my PS3 Controller with Unity but it has been unsuccessful.
I followed this video to do so:
https://www.youtube.com/watch?v=LcettC1QHu4
I have done the same thing as the video but ...
1
vote
1answer
37 views
Gameobjects disappearing when changing renderer.material.color
I'm generating an array of objects using this code:
while(currentPosition.z < poolSize){
var ringObj = GameObject.Instantiate(ring) as GameObject;
...
0
votes
0answers
22 views
How to get vectices of a sprite in correct order in Unity?
Currently, when I examine sprite.vertices, I see that it is ordered in crossed way, like: one from bottom, one from up, another one from somewhere else... etc.
I need the correct order to make array ...
0
votes
0answers
23 views
Save or export Autocad 2015 (mac) model as .FBX, for Unity
I know there is an abundance of these questions floating around, but no where is an exact answer given. I have a model in Autocad 2015 (OS X version) and I want to use it in a Unity game, so from what ...
0
votes
1answer
12 views
Replace text in Unity [closed]
i tried to look up my question but didn't really find an answer that works for my situation.
I'm using this unity asset called Dialoguer to create interactive dialogues.
What I'm trying to do is to ...
1
vote
1answer
25 views
What is the maximum value of a LayerMask in Unity?
What is the maximum value of a LayerMask in Unity (the value when all layers are included)? And how can I find it using C# bitwise operations?
I tried ~0 but it shows -1 in intellisense.
Thanks in ...
0
votes
0answers
20 views
Perfectly overlap GUI bounds to tiles room
I have a scene built with several rooms procedurally generated.
Then I have a GUI which should cover everything which is outside room walls.
What I cannot sort out is how to have the GUI to ...
1
vote
3answers
54 views
How can I set up Unity so that 2d images are displayed in their original resolution?
I took images from my iOS game that I am developing in SpriteKit and put them in a Unity Android 1136x640 screen, which are the same dimensions for the iOS game but the images are a lot smaller. How ...
0
votes
1answer
28 views
Unity mesh collider detecting collision on object empty inside
I'm trying to get my first 3D game done with Unity. In this game the character will be flying through some rings.
I made the ring asset with MagicaVoxel, exported it in .obj and reimported in Unity ...
1
vote
0answers
15 views
UnityWebRequest and/or HttpWebRequest give 403 on Android with PUT
I am trying to post an image captured through my game to Facebook through their SDK, and as it requires a URI, I wrote a simple AWS Lambda function to take a byte array and upload it to an AWS bucket. ...
0
votes
0answers
28 views
Unity WebGL build throws errors
I am working on a multiplayer game for WebGL platform and i am using (http://lockstep.io/ - SocketIo & node.js server ) for handling the game.
I am facing these issues as shown in the attached ...
0
votes
1answer
49 views
Performance Optimization for 2D game developed using Unity 3D game engine
I have a game with almost 160 sprites in my resources folder. I need 15 randomly selected sprites on each level (there are 7 levels).
I load those sprites which are required e.g. my random ...
1
vote
1answer
30 views
Unity3d Transfer of value from one script to another
Script 1
public class enemy : MonoBehaviour {
private Vector3 Player;
private Vector2 PlayerDirection;
public float Xdif;
public float Ydif;
private float speed;
private ...
4
votes
2answers
125 views
Is there a way to turn collision detection system off completely in Unity?
My world setup is 2D Top-Down. All collisions are disabled from the collision matrix.
There are no collisions in the scene as I wanted, but as I perceive, Unity is still trying to calculate ...
1
vote
0answers
30 views
How to have a gradient blur in objects on Unity?
This is related to a previous question I've asked here:
How to blur entire scene but a specific spot in Unity?
At the time I managed to solve my problem with a "hard" cutoff on the blurred and ...
0
votes
0answers
39 views
Unity stream webcam to other player (Multiplayer)
I want to make it possible, that I can draw on the stream of another player in my Unity game. The networked drawing works just fine, my problem is to stream the webcam. I've got the webcam input ...
0
votes
1answer
32 views
Unity LineRenderer custom reapeted Texture with margin
I have a LineRenderer, which has 1 dot as texture, which is repeated over the whole line. Now I want to know, if there is some way to give this dots a margin, so that I can make the gap between them ...
0
votes
0answers
20 views
Unity 3d sendmessage to another script, with parameter of raycastHit?
I am trying to send message from 1 script to another, and need to do something like that:
var hit : RaycastHit;
....
if(soemthing){
checker.SendMessage("MakeEffect", hit);
}
and another script:
...
0
votes
0answers
21 views
LineRenderer doesn't apply material in 2D Unity5
I'm making something that draw lines with mouse on top of everything (in 2D), but the color of the line is always purple even though I assign a material to the line renderer. I could change the color ...
0
votes
1answer
26 views
What is an equivalent of Swift's UIScreen.mainScreen().bounds in Unity 2d?
Basically, I am from a Swift SpriteKit background where UIScreen.mainScreen().bounds is a CGRect which represents the screen and can be manipulated in various ways like getting the middle of the ...
0
votes
2answers
60 views
How to optimize my random terrain generation and usage?
I'm new to Unity. I've created an algorithm to procedurally generate a circle-shaped tunnel made of primitive cubes GameObjects. The problem is that the game is very laggy and I can understand why: ...
1
vote
0answers
29 views
Unity Browser inside UI Panel
What is the best option if I want to show a remote webpage inside a UI Panel in Unity ?
I want to target android and iOs platform.
I had uniWebView in mind but that thing is more like an overlay I ...
0
votes
0answers
23 views
How i can make a spherical world with Cubiquity in Unity
I would like to make a spherical planet with cubiquity in Unity 5, how could I do it with a for (), so I could one cubic planet.
Can anybody help me?
0
votes
1answer
30 views
Unity3d Resources.LoadAll<Sprite> empty array
In my resources folder structure I have myself a file, now in the unity editor this file is a Texture Type Sprite (2D and UI), now when I attempt to run this code in one of my scripts
var icons = ...