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
1
vote
1answer
51 views

When do you use StartCoroutine and when Invoke?

I am confused. Both seem to do the same thing: Delay a method. Both Invoke and StartCoroutine allow you to call a method by name (string). ...
0
votes
1answer
460 views

Unity3d turn based navmesh algorithm

I am developing a game in Unity3d. In this game, 2 teams will fight without any human interaction. The fight results must be always the same, if the same teams are the same. This way, I must ...
0
votes
1answer
30 views

In Unity how do I make a button call everything suscribed to the “onEndEdit” event of an InputField?

How do I make a method (that is going to be called every time that a button is pressed) to call everything subscribed to the "onEndEdit" event of an InputField? I expected something like this: ...
0
votes
2answers
155 views

Unity c# bullet randomly changes position

i have problem in unity im using this code to shoot bullets and it works but when im shooting bullets are moving left automatically or when i will aim it at right it shoots straight instead i'm using ...
0
votes
1answer
21 views

How can I apply setActive to a UI element after an animation finishes?

I have an object animation which plays on the opening of a scene. When the animation is over I want the UI slider to be setActive - allowing the user to rotate the object. I have both these elements ...
0
votes
1answer
44 views

Weird behavior using TextMeshPro

I have a very simple scene setup. What I want to do is to create a button prefab composed of a sprite and a TextMeshPro object. When I group the sprite and the text under a GameObject, the pivot of ...
0
votes
1answer
218 views

Problem with Unity NavMesh tools

I'm getting this error: Runtime NavMesh Builder source mesh combined mesh is skipped because it does not allow read access I checked all the models and it has the read permission. I also noticed,...
0
votes
1answer
112 views

How to set ortho projection / model view matrix without a camera?

I'm trying to create the correct projection and model view matrix for rendering without a camera. _orthoCamera is a camera I set up in the scene view. Using the <...
0
votes
1answer
78 views

Make half of the sprite transparent

Guys if I have two sprites placed on the same spot. How can I show the half of each Sprite instead of the one on top? The sprites are basic circles All sprites have basic colors, no textures.
0
votes
1answer
45 views

Unity get component throwing NullReferenceException only in standalone build

I'm having a very frustrating issue with GetComponent(). ...
0
votes
1answer
64 views

NPC Melee fighting movement issue

So i have been struggling with this for ages and I have now decided to reach out for help. The Problem: The game has two NPCs for reference we will call them "Ally" and "Enemy" Ally and Enemy each ...
2
votes
2answers
89 views

Modify the effect of a card being played

I'm trying to recreate a simple card game. Each played card has an action (draw extra cards, peek at draw stack, eliminate an opponent card, etc). Once played, it goes on a stack, and the card effect ...
0
votes
1answer
31 views

Unity Proximity Warning System Trigger issues

I'm trying to set up a proximity warning system but I'm having some trouble. To simplify things as much as possible: I have two game objects in a scene (Object1 and Object2). Object1 has a large ...
0
votes
1answer
780 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 ...
4
votes
2answers
3k views

Can't clip a sprite that has a custom shader in NGUI

I am using NGUI. I have an "NGUI Unity 2D Sprite". This sprite has a material with this shader: ...
0
votes
1answer
36 views

Animator from another gameobject keeps disappearing from script on play

I am working on a gun script and it worked fine until earlier today when I made a change to the script and it stopped working. I put it back, but for some reason now the animator object attached to ...
1
vote
1answer
86 views

Repeating a mesh instead of stretching it

I would like to put acoustic foam into a case object: To do that, I have created a foam object: Now I'm having a really hard time to cover the case in Unity with this object: I have to adjust ...
0
votes
1answer
537 views

Unity Ambient Occlusion not working with Orthographic camera

It seems like the Ambient Occlusion setting from the Unity Post Processing stack (obtained from the asset store) only works with a Perspective camera, yet I haven't ...
0
votes
2answers
58 views
0
votes
1answer
838 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
1answer
30 views

Animation is not starting even though collider is triggered?

progress is steady but it is a bumpy road. I have removed the animation script from my character and reworked it into the controller script. I have also added new animations. Doing this required ...
0
votes
2answers
192 views

How to avoid enemies overlapping each other when chasing player in Unity?

I am trying to get enemies to chase player but without them overlapping each other when they get closer to the player. So far what I have is that I check for the distance between current enemy and ...
3
votes
1answer
2k views

Global fog does not work with deferred rendering in Unity

When I set deferred rendering the global fog from the Unity Standard Assets does not work, there is no fog at all. With forward rendering the global fog works. How do I add fog with deferred rendering?...
2
votes
1answer
2k views

Unity 5 Networking Send Rate: Send Rate is Zero but server movement is still happening

I have a client server scenario, just a player moving about on the client and he moves about on the server using the built in networking provided in Unity 5. I have my client scene running in the ...
1
vote
1answer
220 views

Animation Dilemma: How to create authentic discontinuous block-like character movement

I am using Unity. I have quite a bit of Unity experience, however I am a novice in animation. In the past I have had someone else do character Animation aside from some Camera animation and simple ...
1
vote
1answer
23 views

Unity Collider2D is causing the game object to disappear upon collision

I have gone through just about everything to try and isolate this bug. I have isolated it down to the enemy collider, but have not solved the issue. When my player collides with my enemy, the enemy ...
0
votes
0answers
17 views

Indicator for multi objects?

I'm trying to make indicator detect a certain objects in my scene. Where every arrow point at separate object. for example, face with two eyes. my script will look for those eyes"dead_point" and clone ...
0
votes
1answer
89 views

How do I make the player gun stop firing when sprinting

I am trying to get the players gun to fire when the player is walking and the stop firing when the player starts to sprint. The gun will work just fine and ire when the player is walking, but it will ...
0
votes
0answers
15 views

Unity Space invaders with top 3 players [closed]

I'm about to create a simple Space Invaders game but I have a difficulty on it, I have to create like a Top3 weekly, from all the users and get the top three most scored users, this is easy, is a ...
0
votes
2answers
34 views

How to limit camera pitch (x rotation) between two angles

I use this script rotate the camera on its local X axis: float v = verticalSpeed * Input.GetAxis("Mouse Y"); transform.Rotate(-v, 0, 0); Right now this lets ...
0
votes
1answer
84 views

How Can I Load Ads Particular Level?

How Can I Apply Ads Different Level?? I Create A 40 Level, Ex: Level1 complete then load ads Interstitial Level2 complete then load ads Interstitial Level3 complete then load ads Rewarded Level4 ...
0
votes
1answer
79 views

Check if raycast is hitting object

I am using the following which is attached on to an enemy, when I press the fire button it lowers the health of that enemy, my problem is HOW do I know if I am actually hitting the game object this ...
0
votes
0answers
11 views

Unity cloud build speedtree textures incorrect type after build

So I finally (after a few days) got unity cloud build to work. When I build it using the unity editor everything is fine. However, when the cloud build service builds it I get some odd textures for ...
0
votes
2answers
603 views

Creating a content pipeline for a Unity

I have a game with lots of assets, such as data files, images, etc. My understanding is that Unity is optimized to know about all resources at build time. i.e. binding those assets to Scene ...
7
votes
1answer
43k views

Graphics Raycaster of Unity; How does it work?

I'm making a small game for the first time and enjoying it thus far. The only thing that keeps bothering me is that I can't find a human explanation of what the graphics raycaster does. What's the ...
2
votes
5answers
8k views

Generate random numbers without repetitions

How to generate Random numbers without repeating any numbers in the given target like(1-5000) there should be no reparation and I should be able to get 5000 randomized numbers. I should be able to run ...
2
votes
1answer
930 views

Unity 5.x Network Synchronization Concepts

Bear with me, It will be long read^^ I am working on the new Unity Networking system. I was using Photon and old (legacy) unity network API's before. But as it seems there are some good benefits of ...
1
vote
2answers
712 views

What is the purpose of the directory Packages in my Assets directory?

So far I used EditorWindow script but few minutes ago without and alert I have strange stuff in the Assets in the Editor. I see now a new folder name Packages I can't figure out where it came from but ...
0
votes
1answer
162 views

Unity3D: activeSelf issues

I've been trying to script some basic AI for a Unity Roll-A-Ball game, which involves two balls collecting cubes for points (one controlled by the player and the other controlled by AI. Everything ...
1
vote
1answer
222 views

Unity, understading Layout element - Min size and preferible size

I have been some time working with unity, and I am trying to get a better understand of the UI system. I am a mobile developer and I am redesigning the UI but I am unable to achieve what I want. My ...
0
votes
1answer
28 views

Send a Push Notification from a device to another device (Unity, Firebase)

I have setup Firebase authentication in my game for Android. I need to implement a feature in my Android game, where a user can challenge another player. I need to implement it this way: The user is ...
0
votes
1answer
12 views

Unity UI glitches while loading

I have the following scene canvas elements: ...
2
votes
2answers
885 views

How do I successfully implement Google Mobile Ads and Google Play Services into my Unity arcade game?

I have been trying for like a month now to properly implement Google Play Services and Google Mobile Ads into my Unity Android Game. I have had success in getting Google Play Services to work but when ...
1
vote
1answer
30 views

Nonsense change of floor and enemies materials (when restarting scene)

I have a game where: player (green cube) enemies (red cubes) floor (blue plane) Image before losing (player colliding with enemy): Image after restarting game: GameOver Code (Player.cs): ...
1
vote
1answer
84 views

Round to the nearest multiple of 0.75 in C#

How can I round a number to the nearest multiple of 0.75 in C# / Unity? The context is that I have a block and I want its position to be rounded at the nearest 0.75 multiple. For example: 0, 0.75, 1....
0
votes
2answers
755 views

When scene loaded up, Position player at a start point. (Unity2D)

If pointName and player.startPoint are true, shown by the inspector, why doesn't the player's position go to the start point with a pointName of "ToNeighborhood". Note: The code runs if pointName == ...
0
votes
1answer
1k views

Click to move - get NavMesh layer

I'm using NavMesh, and NavMeshAgent for my character movement and Pathfinding. I made a testing NavMesh with 2 area layers: 0 = Walkable 3 = ...
0
votes
1answer
24 views

OverlapBox() dimensions are huge but are fine when tested in isolation

To be completely transparent, I more-or-less copied this question from the Unity forums since I did not get a reply. I'm creating this system where I'm placing level chunks together and I need to ...
0
votes
2answers
54 views

How to handle grid snapping when the object is greater than the grid cell width and height?

I want to be able to move objects on a grid always by what the grid cell size is, and objects bigger than the grid size should not overlap. The cube in this GIF below is snapping how I want (1 x 1). ...