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
1answer
428 views

How can I attract & repel the mouse cursor from particular UI controls?

This question came from some of my students. I wanted to share it here so others can find & improve on the solutions we've found so far. In particular, my answer below doesn't behave as well as I'...
0
votes
1answer
243 views

Draw animating grid with terrain deformation and variable colors

I'm trying to draw a grid around the cursor that represents buildable area. this cursor grid, aligns to the global grid. all building placements must be on the grid and so this visual queue must aid ...
0
votes
0answers
26 views

Why the character new position is not on the second teleporter but near a door?

If the two teleporters are in the same room it will teleport the character fine from the firsdt teleporter to the second. but when I moved the second teleporter the green one to another place in my ...
0
votes
2answers
229 views

Is it more efficient to add scripts to each GameObject or to a single parent object?

Does a C# script added to a parent object work more efficiently and effectively (in terms of both memory and performance) on all objects, in my case lighting, or adding script components to each ...
0
votes
2answers
422 views

Limit position rigidbody

How can I limit the position of a rigidbody, between two values ​​if I use this code: ...
0
votes
1answer
209 views

Unity2D - Horizontal Scaling to Support Various Aspect Ratios?

I am trying to work out how to support various resolutions for my Android game. I have come up with a solution, but do not know how to implement it. Automatically, I am told that Unity vertically ...
0
votes
1answer
61 views

Improving Rigidbody collision between real-time movable object and other Rigidbodies

I have a cube that has been scaled to be rectangular (controlled by a remote Raspberry Pi gyro/accelerometer/magnetometer) and am translating its orientation into Unity via calls to ...
0
votes
1answer
203 views

Unity toggleable shader property misbehaves when set by code?

I've added a toggle to my shader: [Toggle(ENABLE_COLOR_BLEND)] _EnableColorBlend ("Enable Color Blend", Int) = 0 In the Subshader: ...
0
votes
2answers
2k views

Unity remove logo in splash screen

Heavily related to this question, as of now, Unity's TOS has changed dramatically. And searching in the TOS, it looks like I'm allowed to remove the Unity logo in my exported game. Looking at Section ...
0
votes
1answer
57 views

Item counter unity

How is it possible that a create an item counter in unity? My current Scripts - Counter.cs ...
0
votes
1answer
2k views

Architecture of “doodle jump” type gameplay infinite looping background

I am planning make a doodle jump type game, character jumping on platforms. A scrolling or doodle jump like background which ll appear to move when character moves upward and appear moving (just like ...
0
votes
1answer
10k views

How can I make my player move in the direction the camera faces?

I have a 3rd person camera which can rotate around the player. My problem is that wherever camera is facing, players forward is always the same direction. For example when camera is facing the right ...
0
votes
2answers
954 views

How do I make my character jump in any angle?

My character is a square which can spin in any angle but it can not jump in certain angle. Can anyone help? ...
0
votes
1answer
3k views

Unity Performance: How many Materials per Object?

I have learned that a Mesh with 4 Materials each 1024x1024 in Size is somewhat slower than a Mesh with 1 Material 2048x2048 in Size? In my usual workflow I tend to seperate different Materials into ...
0
votes
1answer
239 views

How do I make my character jump in every direction?

My character can only jump when he is grounded, but he can only grounded in one direction I want him to jump in every direction, can anyone help? CAN JUMP : CAN'T JUMP : Code: ...
0
votes
2answers
4k views

Projectile Direction Unity

I want to shoot a projectile in the direction the gun is facing. With my current script it only shoots vertically. (I can also make it go horizontally but that's it). This is my ...
0
votes
1answer
61 views

Interactive texture modification (such as swirling) in Unity

I am working on a game where I want to allow users to mix multiple colors (similar to shown in this video): https://youtu.be/11UFYyv8hjs?t=316. I have the following questions: I am expecting that ...
0
votes
2answers
911 views

Best way to create a Chromadepth shader for unity?

I'm trying to create a chromadepth environment in unity3D. So the camera sees close objects colored as red, and then farthest objects as blue. And everything in between falls down the color spectrum (...
0
votes
1answer
2k views

SVG textures for 3D game objects in Unity?

Is there a way to make textures using vector graphics and use it for 3d models so that textures would be object size independent and won't get blurry?
0
votes
1answer
266 views

What is the geometrical interpretation of Input.GetAxis(“Mouse X”)?

According to the documentation, Input.GetAxis("Mouse X") produces a range of values from -1 to ...
0
votes
1answer
77 views

How to place a camera so that it always fits a plane?

I have a plane that can get its scale changed during the game, and I want to make the camera view it completely every time the plane has its scale changed. The only camera is set to perspective ...
0
votes
1answer
564 views

Unity OnCollision() not working

Seem to have exhausted google looking for an answer to a VERY bullet simple code that should work. ...
0
votes
2answers
3k views

Unity c#: Interface object never equals null

I've created an interface class for some mechanic I'm using to interact with things in my game. Now, I noticed that checking if that value is null never returns true. Here's a screenshot of where this ...
0
votes
2answers
1k views

Why is Vector3.MoveTowards only working on a single frame?

I have three laptops in my scene and I am trying to bring them to front when I click on them. I am able to recognize which laptop is clicked by using the code below, but it doesn't move to the focus ...
0
votes
1answer
143 views

How to Store Design Data in Unity including Formulas?

My team is switching to Unity 3D for an upcoming project. I'm tasked with converting our game data system into Unity. Our existing games use spreadsheet documents (Google Docs) for designers to set ...
0
votes
3answers
5k views

Using Unity's `transform.translate()` to translate relative to an object but only using two axis

I'm using transform.translate() to move an object around the world space, relative to the camera that is following it. The camera has an angle of 23 degrees on the ...
0
votes
2answers
575 views

the countdown timer inside while loop not working [duplicate]

i am instantiating prefab cars ... the clones had a random countdown timer with each one off them and its working very well but the its not decreasing its not counting down the timer is inside the ...
0
votes
1answer
2k views

How to link my weapons with their corresponding ammo supply in the Unity Inspector?

In my game I would like to implement a universal ammo and weapon system that would be usable for any kind of weapon. So I declared an ammo class: ...
0
votes
1answer
2k views

FB.Init() is not accepting in my c# Script

I am trying to connect fb with my game. its first time i am connecting fb with game. i downloaded fb SDk 7.3.0 and i am using unity 5.2.1f1. i imported the sdk in my game asset. then i created a new ...
0
votes
1answer
1k views

How to add high score?

I wanted to add a high score to my game but I don't know how I already tried to find some videos for it but I just can't find the right one. I already have a scoreUI on my game I just wanted to add a ...
0
votes
1answer
515 views

Unity can't add script component

I keep getting the following error when i try to drag and drop a script to my gameobject: I have made sure that both my Script name and the class name is : Soldier ...
0
votes
2answers
3k views

Accesing child GameObjects of GameObject

I have already tried really much with all "GetChildren" and similar functions, but I haven't found out how to do it yet. I have a GameObject named "koffer". I have added several other GameObjects as ...
0
votes
2answers
663 views

Move GameObject with defined lists of position and rotation

I'm working on playing a replay on every strike. For that I'm recording the positions and rotation of the sphere in the list individually. I now have the values reside in the list. How do i move my ...
0
votes
0answers
131 views

How can I create a “rain drops on camera lense” effect with the HDRP?

I did follow this tutorial https://www.youtube.com/watch?v=OG7zyogrUTs&t=115s but I did not made it cause I am using HDRP and they are not using HDRP so the problem is I can't use the normal ...
0
votes
2answers
1k views

Dragging a Rigidbody2D without passing through obstacles

I have this body of code written for an object that needs to be an obstacle and another object that is draggable. I have colliders on both and a kinematic rigidbody on the draggable object, but the ...
0
votes
1answer
2k views

How to make a proper release build - Unity Android - x86, ARM32, ARM64

I'm trying to create a release on Google Play. I currently have Build App Bundle checked in the build settings, and it helps decrease the build size. In player ...
-2
votes
1answer
887 views

Energy Bar in Unity [closed]

I want to display a debug message when the progress bar is loaded fully and I have a button "refresh", when I click this it should reload the progress bar. Here is the code I have tried: ...
-2
votes
1answer
4k views

Unity - How To Save Some Variable WIth PlayerPrefs?

I have a small problem. in the game that I'm creating I created an array of items, each item includes a number of variables (cost, level, etc.). my goal is to save your own variables for each item, ...
-3
votes
1answer
12k views

How to call a public function from another script in Unity? [closed]

...
107
votes
1answer
30k views

How can I create a “see behind walls” effect?

Divinity: Original Sin 2 has a beautiful see-through system. When I go behind walls, a splash mask will appear, and when I move around the game, it changes. It's like a dissolve shader, and has a ...
68
votes
1answer
10k views

How can I replicate Quantum Break's distortion particle effect?

Quantum Break has this fantastic particle effect, it's a distortion effect like broken glass. I want know how I can replicate this effect? You can see it below, and a full video is available on ...
65
votes
6answers
63k views

What are the pro/cons of Unity3D as a choice to make games? [closed]

We are doing our school project with Unity3d, since they were using Shiva the previous year (which seems horrible to me), and I wanted to know your point of view for this tool. Pros: multi platform, ...
30
votes
2answers
65k views

How to correctly draw a line in Unity

I'm working on a game which requires me to draw a few lines from a single point that is more formally said Given point A with coordinates x,y I draw n lines where the i-th line has the coordinates ...
27
votes
8answers
31k views

Algorithm for creating spheres?

Does anyone have an algorithm for creating a sphere proceduraly with la amount of latitude lines, lo amount of longitude lines, ...
13
votes
1answer
4k views

Creating a Robust Item System

My aim is to create a modular / as generic as possible item system which could handle things like: Upgradeable Items (+6 Katana) Stat Modifiers(+15 dexterity) Item Modifiers(%X chance to do Y damage, ...
15
votes
3answers
32k views

Can I do server side programming with unity? [closed]

Another thought to my last question. If i were to do a client/server game with unity3d would i be able to do serverside programming with unity? if not can i use C# .net? if not then is there some sort ...
26
votes
7answers
10k views

How can I avoid tight script coupling in Unity?

Some time ago I started working with Unity and I still struggle with the issue of tightly coupled scripts. How can I structure my code to avoid this problem? For example: I want to have health and ...
26
votes
2answers
70k views

What is the pixels to units property in Unity sprites used for?

I'm starting to learn Unity for 2D development. So, I am importing several sprites into the game, and I couldn't help but notice that there is a "pixels to units" property, by default on ...
13
votes
3answers
3k views

How can I do unit testing in Unity? [closed]

How to implement Unit Test at Unity3D. I wonder if it would be possible to extend the Unity editor to have some sort of testing framework in it. Is there any guideline to implement it? Any ...
28
votes
4answers
14k views

How can I build a game in Unity with minimum/no use of the visual editor?

I'd like to write a game completely in C#. In my search for an engine, I found Unity3D, but all the tutorials and documentation are speaking about a visual editor and the Unity IDE in which you click ...

1
3 4
5
6 7
17