Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
0answers
23 views

Restrict object movement inside irregular shaped container

I want to restrict object movement inside an area. My object follows cursor position. I have already done that for the area border using Mathf.Champ to the translate because the borders are square ...
0
votes
0answers
15 views

Writing an underwater wave water refraction shader

While there are plenty of online tutorials out there on underwater effects very few of them help with creating the effect of being near the surface where volumetric rays are cast down and when you ...
1
vote
0answers
37 views

Unity : How to detect if a UI button is pressed down?

I want a UI up arrow button to be able to detect if it is pressing down. It is a child of a canvas in a 3D scene. My target platform is webGL for both desktops and mobiles. I coded not only the ...
0
votes
0answers
11 views

Need Help implementing Perforce depot or GitHub repot that allows offsite cloud hosting with onsite primary server syncing between local machines [closed]

Essentially, I have been working towards finding a simple solution using either perforce or GitHub desktop or a combination of the two. I would like to create a repot/depot on a GitHub server or ...
0
votes
1answer
138 views

How do I slow down time without affecting the player? (shortened question to ONLY the code and its bugs)

how do i slow down time without slowing down the player as when i tried to implement my own version ...
0
votes
1answer
32 views

Is any Update() called always first than any LateUpdate() from other scripts?

If a script is called at a specific moment in the script execution order, will every LateUpdate() functions from the rest of the objects work after that Update()? The documentation isn´t clear about ...
0
votes
2answers
40 views

How would I apply force to a bullet in 2D?

I wrote the code below in order to try to get a bullet to fire at a specific angle for my top-down shooter. However when I press space the bullet just spawns in front of the game object despite it ...
0
votes
1answer
13 views

Enabling / disabling Static objects in Unity

The Unity docs clearly explain that game objects marked static should not be moved for performance reasons but I can't find any info regarding enabling / disabling. Almost everything in my games ...
0
votes
0answers
11 views

Ball is moving with constant velocity but not attaining same distance

I have created a Kinematic equation of calculating the velocity required to launch a ball so that it passes through a given position. This velocity is being calculated for each time ball collides with ...
0
votes
0answers
30 views

Not serialize but show them in inspector - Unity

I have a serializable class, like so: ...
0
votes
0answers
13 views

How do I use sharpNLP in UNITY? [closed]

Anyone know how I can use sharpNLP to phrase natural language strings into commands within Unity? There is also standfordNLP but I think that is not c#. Anyway, any help would be appreciative.
0
votes
2answers
91 views

2D character movement

My character moves right and left correctly, I want to know if it is possible to move character forward and backward to collect hearts (I know that in 2d no z axis I want to know if it is possible ...
0
votes
1answer
40 views

Unity: Creating Word Search highlighting

For days I am struggling to implement the highlighting functionality in game as there is not much tutorial also for this. I did how ever make the cell of the grid change the material color but it ...
0
votes
2answers
90 views

How can I implement pathfinding that avoids obstacles on a spherical planet?

Hi everyone, I am trying to make the enemy go around the planet, towards the player (I am using Faux Gravity for the movement logic). I tried using Unity's NavMesh tools, but because this is not a ...
0
votes
1answer
27 views

Unity: how do I make an input only available to the code?

I have a simple function attached to a button. I then decided to change it by adding an input. The problem is that the function won’t run unless I specify the input in Unity via the inspector. I don’t ...
0
votes
2answers
40 views

UNITY || How to access the “exit transitions” of the current played clip from the animator?

So, I have an animator , i can access it. But from there I have no idea how to access the clips inside. I need to access the transition of the clips. I got as far as accessing the object of the "...
0
votes
0answers
10 views

Unity, animation starts too fast

If I start the game my animation is like 20 times faster then I set it, after I move direction and back to the idle pose where the animation is set, it turns back to normal speed. I didn't changed the ...
0
votes
0answers
26 views

How can I get rid of in-game Aliasing?

I am creating a 2D game in Unity. The sprites in my game appear to have their pixels only allowed to be in set positions of the screen, making the textures sort of aliased to a low degree that causes ...
1
vote
1answer
23 views

Detecting collisions during animations

I am creating a prototype enemy swordsman, and I'd like to be able to parry his attacks, like the parry system from VR Dungeon Knight. This is my method of implementation: Parent a sword to his hand ...
0
votes
1answer
33 views

Custom mobile keyboard in unity

I'm trying to create a falling word typing game like z-type. I have used the code provided here — but it's is only for keyboards: ...
0
votes
0answers
44 views

Unable to change value of Input Field text component

Learning about UniRx and ran into a seemingly small problem that I can't seem to get my head around... ...
0
votes
1answer
28 views

How to add emission to texture in shader?

I want a texture to emit itself by 1, not more. In Standard Shader I enable Emission and set texture to Color and Color to 1. I don't need emission to go beyond the object, I only need the texture to ...
1
vote
1answer
54 views

How can I make a two-eye-view effect using two cameras?

I have two cameras. The second was made by duplicating the first. Then I changed both cameras' viewport rects: First Camera X = 0 Y = 0.25 W = 0.5 H = 0.5 Second ...
0
votes
0answers
23 views

Black screen show when Run game in Android device, Works fine in unity editor

I got below logs in android studio logcat: ================================================================= ...
0
votes
1answer
23 views

Creating materials in modeling program vs in Unity: when to do either?

This is something I should know the answer to by now, so I'm asking to clear up the gaps in my knowledge: As I (re)learn about shaders, specifically in relation to Unity, I see all sorts of ways to ...
0
votes
0answers
25 views

OnTriggerEnter Only triggers once

I am trying to check when the player has collided with an NPC to trigger dialogue. It works perfectly fine for the first character, but does not trigger anything for the second. When I debug print, it ...
1
vote
2answers
82 views

Structuring game narrative. Handling NPC, Quest, General Dialogue. Is Json/XML the right way to go? Or any other solutions?

Hello guys I'm try to make some games that have more to it than just simple high score scrolling shooters etc. I'm trying to design my own systm of handling narrative. I want to be able to place NPC'...
0
votes
1answer
21 views

Combining several passes in shader in Unity

I am very new to shaders but can't seem to find an answer to my problem. To put it simple I have created a flag shader, which can apply texture, animates and should also react to light. The problem ...
0
votes
1answer
9 views

Get the mesh Project Plane on Click and calculate its area

Here is the excerpt of my script which is calculating the surface area and face area of a mesh on OnMouseDown Event. ...
0
votes
0answers
32 views
1
vote
0answers
27 views

How do I create textured landscape in low poly style?

I'm trying to create something similar to this kind of artistic landscapes in Unity. I've been from trying to use Unity's terrain system and Gaia to making it in Blender; no matter how I can't figure ...
0
votes
2answers
35 views

How To Destroy/Deactivate one enemy without affecting other enemies of the same type?

In my game, you jump on zombies'heads to squash them. Currently I'm only able to have one zombie in my game. When I add another (duplicate or drag from prefab), then run the game, I can squash one ...
0
votes
1answer
42 views

How to check for mesh overlap?

I'm creating a level editor in Unity. I need to detect when an object is intersecting another as I don't want to allow the user to place an object when it is colliding with something else. In the ...
1
vote
1answer
36 views

Unity - job system compatibility for end user?

I'm thinking about using Job system. But it requires .Net 4.x (also look like .Net 4.x will be default for Unity in 2019). It is a little hassle for me cause I'm using Visual Studio 2015, I have to ...
0
votes
1answer
19 views

Object activate it self without script order?

I have strange thing here in my script. In this script clock_time turn active lamp object one by one. Where Lamp object turn off after 3 seconds be anther script. If clock time reach 120 or higher ...
0
votes
0answers
22 views

Blurry text in Unity UI at default scale

I'm working on a VR (GoogleVR Cardboard) game, and need to include UI elements within it. Ever since I first learned how to use Unity's UI elements, I've been limping around what seems to be a major ...
0
votes
0answers
10 views

Smoothing noises with different amplitudes (Part 2)

Well, I'm continuing this question without answer (Smoothing random noises with different amplitudes) and I have another question. I have opted to use the contour/shadow of a shape (https://...
0
votes
1answer
28 views

How to stop all character movement when jumping against the side of a platform?

My Sprite is Moving against a platform. I have a script and an unusual one (that's what one of the member said.) My isGrounded isn't using any rayCasting. I didn't have any problem with it but when I ...
0
votes
1answer
19 views

Drag object with mouse in diagonal direction

I have a gameobject which i want to move using mouse. Currently i can do that in x-axis and y-axis: ...
0
votes
0answers
8 views

How can I get ping value from Photon Cloud?

I am trying to get ping from Photon Cloud but it always shows 0. I use method GetPing(); ...
0
votes
0answers
26 views

Algorithmically fracture a mesh in Unity3D?

I want to create a plugin which shatters/fractures meshes, so I can make every object destructible if I want to. Like in Unreal's built-in feature. My quick approach to this problem is randomly ...
0
votes
0answers
12 views

Can Player's child object call [Command] function?

I have Player and a child as a Gun attached to it. Gun has Firing script. I wanna know how can I call [Command] function from <...
-1
votes
0answers
77 views

Unity Banner ads overlap to next scene and it showing 5sec delay

i'm using 2 ads. one banner ads in my 1st scene and interstitial ads in my 2nd scene. whenever i opened my game banner ads showing delay 5 sec and when i hit play button interstitial ads showing when ...
0
votes
1answer
19 views

GameObject.FindWithTag throwing weird errors

I've got 2 first person controller scripts, one that handles functionality for basic movement, the other handling looking around. I also have a "CursorLockManager" script, that handles the cursor ...
0
votes
0answers
35 views

How to calculate faster how much a collider is going through?

So I think this may be an overkill, but am casting two different rays for a single collision. This is because the physics´ system in unity detects collision contacts in the wrong place when ...
0
votes
1answer
31 views

Why is there a difference in frame rate between my fps calculation and Unity's calculation

So I wrote my own script for calculating framerate but it consistently comes out with a different value than Unitys idea of current framerate. This is my implementation ...
0
votes
1answer
25 views

Oculus Rift Touch controller input not working for some users in Unity 3D

I am working on a music based game that supports both Oculus Rift (touch controllers), HTC Vive and also no VR. Everything is working fine, but the past few days I have been stuck with 1 bug and I don'...
0
votes
1answer
102 views

How to calculate the surface area of a mesh

I am looking for a way to calculate surface area of a 3D mesh object and found this code from a Unity forum: ...
0
votes
1answer
26 views

Trying to trigger dialogue when the space bar is clicked, and two objects are colliding

I'm getting a NullReferenceException on OnTriggerStay. I've been going crazy trying to figure out why. I have tried to cut this down to only the relevent information. I got this code through a ...