Questions tagged [unity]

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.

Filter by
Sorted by
Tagged with
0
votes
0answers
408 views

Serializing and writing a Dictionary of Vector2 keys and custom class values in Unity

I have tried to create code to serialize a Dictionary of <Vector2, Block>, where Block is a custom serializable class, loosely based off of this guide. I need ...
0
votes
1answer
338 views

Baked GI artifacts with Blender and Unity

I've created a very simple model in blender, exported it as FBX and imported in Unity. When I generate light maps on unity I got these strange artifacts (check the images attached here). I've verified ...
0
votes
1answer
1k views

Photon disconnected without any error/warning message

I'm making online game with Photon and Unity. It was working fine, but suddenly players are disconnected without any warning or errors. It just happens sometimes fast, sometimes slow, but always ...
0
votes
1answer
2k views

Unity: Smoothing between two floats which are continuously changing

I'm looking for some help with smoothing between an original float and a target float, where the original float is consistently changing (potentially interfering with interpolation techniques and or ...
0
votes
1answer
2k views

Mute/Unmute Sound For All Game Scenes by pressing Button

My Question is simple i just want to Mute/Pause All Sound of the Game having different scenes. From Scene 1 Which is a Main Menu I Have Two Button On/Off . When i press On Button it stops or mute ...
0
votes
0answers
29 views

Positional noise changes in Unity Editor vs compiled

I have a surface shader that adds a bit of positional noise, using the following code: ...
0
votes
1answer
34 views

How to delay a timer when it's run the first time in update method not using a coroutine

In the code below I am resetting a timer after a duration maxiTime within the update method. I want to delay the timer before it begins to run for a certain ...
0
votes
1answer
656 views

How to handle collision when using sprites in a 3d environment in Unity?

In games like AoE2, they've used sprites for the buildings and they've handled the collisions very well. How would I achieve something like that in Unity? Currently, I've tried using box colliders ...
0
votes
0answers
212 views

rect.Contains strange behavior

Potentially relevant points: I'm using a perspective camera with a 70 degree x rotation so it is almost a top-down view but not quite 90 degrees. Using OnGUI, I'm drawing a rectangle from the mouse ...
0
votes
1answer
103 views

How can I toggle enabled on a specific script within an object in Unity?

I have the CarController script inside my car GameObject. I need to set it to disabled at the start so the countdown timer can start the race. I thought I knew how to do it but once again I have ...
0
votes
2answers
836 views

How do I change from positive degrees to negative degrees?

Recently, in Unity, I tried to move a sphere along a figure-eight path. It first moves in a circle, and after completing the circle, it starts the second circle in reverse, using negative rotation. ...
0
votes
1answer
757 views

Unity rotating camera around specific Vector

I'm making a game in which the player controlls a ball. (Wow, such originality^^) It's a 3rd person game so the camera is slightly above and behind it. The ball is being controlled via WASD. Now the ...
0
votes
0answers
33 views

google play services resources not found error

Everything used to work till yesterday but suddenly today I am getting this error as "Google play services resources not found".What may be the reason for it?
0
votes
0answers
648 views

Do I need to make network game fully deterministic to achieve a non-exploitable MOBA/RTS?

First of all - I know some networking concepts and I coded couple games with GDX/Kryonet/...
0
votes
1answer
149 views

Question about coding rarity and non-MonoBehaviour referencing [duplicate]

I have a non-MonoBehaviour script called Item which contains two classes. ...
0
votes
1answer
900 views

How to instantiate GameObject on client without network?

When I NetworkServer.Spawn(ob) a gameobject and make it a child of a transform.parent after it spawns on both the server and ...
0
votes
0answers
84 views

Set velocity at position?

In Unity3D there's a way to add force at a position and a way to get the velocity at a position. I'd like to be able to set the velocity of a rigidbody2d at a local position. My current solution ...
0
votes
2answers
735 views

How do I slowly decrease a float from 0.5 to 0?

I have a 2D racing game with a track, and the track is repeated with vector2. When I die, I want to slowly stop moving the track, but I do not know how. Here is ...
0
votes
0answers
1k views

Caching the profile image in Unity using Facebook SDK

Recently for my new game i am implementing the Facebook Login. Currently when i login i show the Profile image to the user. ...
0
votes
1answer
133 views

UI gameover score

I have gameover canvas and i like in gameover canvas to show finaly distance i make with PlayerPrefs but doesnt work because is on same scene what can i do for this problem. ...
0
votes
1answer
65 views

Player prefs is not saving data with error Namespaces cannot be used as expressions.?

code: var score:GameObject; function OnCollisionEnter(){ PlayerPrefs.SetFloat("Score",score.GetComponent(Events).i); } Events is the script I assigned to ...
0
votes
1answer
233 views

player 2d rotation

Hello i have one problem with my 2d game a made 2d endles racing game and i add cars spawner with prefab and on this scripts i add and coin whith box collider 2d and make trigger and when i play the ...
0
votes
0answers
44 views

How does Unity Inspector handle values changing during play without any thread-locks?

First of all, I'm a Java coder. Usually, when you write a game, you run it on thread different than the UI one like: ...
0
votes
0answers
509 views

LineRenderer not working using Vuforia in Unity

So I'm trying to render a line that shows up when camera sees an image target and moves around with it. Very typical AR application. But my line renderer doesn't seem to show at all. Here's the code:...
0
votes
0answers
206 views

Unity - Serializing a single property or UnityEngine.Object reference

When I call new SerializedObject(obj) where 'obj' is a UnityEngine.Object instance, as I understand it this is what it does: Each serializable property of the object is traversed, and its sub-...
0
votes
1answer
525 views

Instantiate prefab disabled scripts

I'm creating a script to dynamicly load a menu with buttons. On every button there is a script that need to be run when the button has been clicked. For the button there is a prefab where the script ...
0
votes
0answers
202 views

8 days stuck, I upgraded project from Unity 5.4 to 5.5 giving Failed assemblies stripper.Same with 5.6

My project was working fine when I was at Unity 5.4, As soon as I upgrade my project to 5.5 It start giving me this error when I try to build apk, so couple of days back I upgraded it to 5.6.1f1 and ...
0
votes
0answers
288 views

Difference between a normal function and coroutine without yeilding anything

I just came across a coroutine in my project, which does few calculation, which could have been done using normal function.There is no loop in that coroutine and contains ...
0
votes
1answer
468 views

How to store an array of prefabs together with configuration parameters

I have attached the following script to a number of weapon prefabs: ...
0
votes
0answers
533 views

Mythbuster: Mirror Operation with Quaternion

Mirror operation : all vertex positions must be reflected by a specific plane (here YZ).Synonyms: FlipHorizontal, SymmetryX, MirrorX, What implementations I already know that work: 1) Multiplying ...
0
votes
1answer
1k views

Animating child objects via parent object animator in script

I'm using unity 5 I'm trying to animate multiple child objects via a parent object. The animation worked in the animation view but would not work when I tried to preview the game. In the script I use ...
0
votes
2answers
521 views

Fixed distance between character and ground whatever slope value

I am working on character moving on any ground meaning whatever slope degree ,the result i got is the character does not moving on just shake in his place the following the code i wrote ...
0
votes
1answer
841 views

Am I experiencing a gimbal lock problem when rotating my cube? [duplicate]

So I'm trying to build a simple mechanic where the player see's 3 sides of a cube at a time: top, left and front(I called the front-side "Right" in my code, due to the orthographic view). The player ...
0
votes
1answer
4k views

How to stop an animation on last frame until condition is met in Unity?

I have an animation (fishing) I want to play backwards when the player catches something or cancels the action. Playing the animation backwards is as simple as setting the speed to -1, ie: ...
0
votes
1answer
132 views

Change width and height of 2D object based on pixel size and count

I'm working on a shooting simulator with shooting goals that need to be in real world size. I know the certain size of screen display and pixel counts. Is there anyway to change their size based on ...
0
votes
1answer
608 views

Unity Mobile project, button problem “CrossPlatformInputManager.GetButton” not working

Good afternoon, I have a problem with an input in my code: Before testing it on mobile I tried on PC and the code to make my player sprint was like this: ...
0
votes
1answer
50 views

Move object towards the center of coordinating system

I would like to move a object towards Vector2(0, 0), but every time I use this script, the object always goes down, instead of going towards the center of the coordinate system. ...
0
votes
1answer
243 views

Unity 5.6 - Compilation Error with UWP using Facebook SDK for Windows

I built my unity game for UWP and I added winsdkfb to authenticate user with facebook ID. When I build my project in visual studio 2017, it throws an error which is: Severity Code Description ...
0
votes
0answers
62 views

A* move to excact position, if close, otherwise approach

I'm using the A* project from http://arongranberg.com/ and have this annoying problem, that I'm incapable of solving. When walking to a destination, I want my units to just get close to the waypoints ...
0
votes
0answers
277 views

Process Purchase Event get called on each App launch - iOS

At present when I launch the app, each time ProcessPurchase event get called in iPhone device. Though upto now I have not pressed any purchase related buttons. Yes I have setup subscription purchase ...
0
votes
1answer
1k views

Socketio, nodejs. syncing movement with rigidbodies over the network - unity

I am building a 2d top-down mmo. very lightweight. I have a master client that determines everythings position, and actions and send this information to all other clients. Now I have made a great ...
0
votes
0answers
49 views

Determining whether a large building should be split into multiple scenes

This is about designing a first person retro game in Unity3d. In this game the player would walk around inside a large maze-like building that has corridors on 10-15 different floors. Each floor has ...
0
votes
1answer
796 views

Unity 2D - Tile based puzzle. Game Over logic doesn't work

I'm trying to create a clone of the popular mobile game 1010! However I am struggling to determine when the player can no longer make any moves and therefore it is game over. Can you see any flaws in ...
0
votes
1answer
56 views

Method for Modifying Numbers based on Attributes in a Game [duplicate]

A game that I'm working on in Unity has a diverse set of spells. The player character and NPCs all use an attributes which modify these spells in different ways. Our design is very fluid and the ...
0
votes
1answer
3k views

Unity RigidBody2d.MovePosition() not working on dynamic rigid body

As it says, .MovePosition() won't move my character. I know other ways to move but I want .MovePosition() in particular as I think it will solve the camera's jittery movement when the player pushes ...
0
votes
1answer
64 views

How to add a volume bar like YouTube for iOS?

I am almost done with my game in Unity 5. However when the player presses Volume Up/Down, the iOS (version) shows the standard UI to show volume. Android has it's own (looks better on Stock). I want ...
0
votes
0answers
570 views

Unity 5: How to make a Unity 5 Physically Based shader Catmull-Clark subdivision tessellation for increase LOD if possible using visual scripting?

I'm using Amplify shader visual scripting to make tessellation and increment level of detail of the 3d mesh. But is not applying Catmull-Clark subdivision round smoothness. And my model still looks ...
0
votes
1answer
2k views

How do I reference a particular UI Image or Sprite in my assets folder?

I have an Item class, and I want to associate an Image class with it. How do I get a reference to the intended ...
0
votes
0answers
2k views

Downloading a file with UnityWebRequest

I need to download a file (a .ogv video) from a server using a UnityWebRequest. Let's say the file is located at home/folder1/folder2/file.ogv on the server, and ...
0
votes
1answer
868 views

Default mipmap level & elements to use for CopyTexture in Unity Scripting?

I want to make a tiled map. I want to use the function CopyTexture to copy from a Texture2D (where is stored my tileset) to a RenderTexture. I want to use the third overloading (with all the ...

1
223 224
225
226 227
251