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
37 views

Unlock the level system with playerprefs score? [closed]

In Unity I would like to make a system to definitively unlock a level (scene 2) which is in a UI button on the main menu once the score of 100 is reached in scene 1. Thank you in advance for your help....
2
votes
3answers
111 views

Any way to guarantee the order of objects returned by FindObjectsOfType?

I wanted to create my spawn points for NPC's and also the player inside my 3D modelling software. So when I import each level, it has its own set of spawn points already built in. This seems to work ...
0
votes
0answers
32 views

Why the transform is not rotating at all?

...
0
votes
1answer
27 views

For some reason the player rotation is not that smooth as I thought it was. What could be the reason?

It seems that when the player starts rotating it looks like a small "jump" of the rotation and then the rotation gets smooth. At the top of the script : because I want to rotate on the Y ...
0
votes
0answers
45 views

how to create something similar to warcraft 3 local avoidance?

I want to write a script that can lead to something like https://gyazo.com/90d3a0ec82a41f53c831b00c403dc7df (to surround the enemy through local avoidance). i am using navmesh unity, to solve this ...
0
votes
0answers
24 views

Why aren't my Vector3 comparing correctly?

I have a machine and a I want to check if I can place a conveyor at its connexion point. I do it by checking if the machine is at the expected Input position of the conveyor and if the conveyor is at ...
0
votes
1answer
52 views

How to convert large grid data to easily saveable format?

I'm trying to recreate the grid system from RimWorld, and I'm facing an issue when having to save the map, which can be up to 500x500 tiles in size. My map has multiple layers, the base layer is ...
0
votes
1answer
27 views

Simulating Road Traffic/Overtaking - Overtake works mostly, but starts clipping other vehicle

I am trying to improve on my Car class, which is used to make a small road scene with 3 lanes each direction with the ability to overtake by changing lanes. I had a very basic version working with all ...
2
votes
1answer
107 views

Creating walls for a racing game?

I have the following kind of race track: As you can see some walls are talls but some aren't... Question: How can one create invisible walls so that cars stays in track? More exactly, how to model ...
0
votes
0answers
20 views

The scene becomes dark when reloaded

I have a prototype of a simple game. When I hit a spike, the game restarts, but when it does the whole scene becomes dark. The light intensity level stays the same. ...
5
votes
1answer
820 views

Invert the colour of pixels where 1 bit sprites are overlapping

I have a simple scene in Unity that makes use of some simple art that uses either white or transparent colours to create a 1-bit art design. The image below shows this. I want to have a that if two ...
0
votes
0answers
31 views

Unity Job System - Transform movement but checking collision with wall

I am trying to get this Unity Job System to work on my top-down shooter 2D game I am currently using transform.position to move player around. I can do it in the ...
1
vote
0answers
20 views

Unity Dropdown ClearOptions/AddOptions does not work for me

I am using Unity, and wrote down a script below: The problem is it doesn't recognize the ClearOptions or AddOptions. All the ...
0
votes
1answer
36 views

Why the Lerp never ending at 0?

0.001266956 ...
0
votes
0answers
11 views

ArticulationBody Stability Stopgap

I have an ArticulationBody with a relatively large number of joints that interacts via capsule colliders with a static mesh collider. This works pretty well under most conditions, using continuous ...
1
vote
1answer
44 views

Performance issue when particle system occupies most part of the screen

I'm using particle systems to create stars in my space sim project. The star is made off 2 particle systems: star surface (max particles: 500) and corona (max particles: 250), both use the Mobile/...
1
vote
1answer
33 views
0
votes
1answer
16 views

ArgumentException for unused axis

I'm creating a simple Pachinko-style game and using a single button to drop balls in. Everything is working great, but the Unity Editor is throwing an ArgumentException for the Submit axis "not ...
0
votes
0answers
31 views

How to access GameObject inside Action

I'm stuck inside an Action : ...
0
votes
1answer
41 views

Why does only the sound for turning off the flashlight play?

This script is supposed to play a sound when I turn on the flashlight sprite and a different sound when I turn it off, but for some reason it's only playing the second sound. ...
0
votes
1answer
20 views

How to use Texture2DArray with Normal map and Normal Unpack node in Shader Graph

I am extracting Normal Map from Texture2DArray in shader graph and then converting it to normal using ...
1
vote
0answers
34 views

My screen wrap code is not working properly

I am new to Game Dev. I am trying to make a asteroid shooter like game with screen wrap (in unity 2017.4) But the screen wrap code is not working well View Faulty Screen wrap in action by clicking the ...
0
votes
1answer
17 views

Material overridden when importing package between 2 pc

So I work with my colleague A and he has (for example) a basic scene A exports the scene as package to give me. and on my pc with new project I imported the package everything is fine and I make ...
0
votes
2answers
57 views

How do I make my camera avoid being blocked by or intersecting obstacles?

I have a regular Camera and this script is attached to the camera. When I rotate the camera around and the camera hits an object sometimes the camera gets pushed and if the camera distance from the ...
1
vote
1answer
53 views

How can I set up enemies spawning in set locations in every level in my Unity game?

I'm new to Unity and I've made a game in which I can make the levels using prefabs quickly, but I found that making Enemies in prefabs isn't a good idea because they can't follow or interact with the ...
0
votes
0answers
24 views

How to efficiently animate 2D scene spanning sprites in Unity?

Our game is a 2D point-and-click adventure game. One of the levels is set in a factory with conveyor belts that span the scene. The game is hand animated in 2D and so animating these conveyor belts ...
0
votes
1answer
24 views

Unity Texture2DArray is too noisy

I've generated a Texture2DArray from array of Texture2Ds and for some reason, when my shader is using Texture Array the output ...
1
vote
1answer
19 views

How should I make and use a method for changing the camera(transform) position and angle at run time from any script/s?

The script is attached to a Camera. A bit messed but it's working. For changing the camera height at run time I'm using a variable name cameraHeight at this line number 88: ...
0
votes
1answer
28 views

Is there a way to create animation from array of 2d sprites in runtime that works in build in Unity

I have an array of sprites that is created at runtime and I would like to create animation from it, so the specific animation would also exist at runtime only it would act as preview animation. I ...
1
vote
0answers
13 views

How to animate a customizable pixel art platformer character?

I am working on a 2d platformer which is made up of pixel art. I want to make my character customizable like in stardew valley. How can I implement it and create animations for my game like run , idle ...
0
votes
1answer
21 views

Can I change an Android IAP's type from Consumable to Non-Consumable?

I was inspecting a bug with one of our old Android games, where a "level pack" in-app purchase was being lost after the player re-installed the game etc. The issue became obvious when I ...
0
votes
1answer
31 views

Why does my spawner spawn multiple times at start-up, only in build?

I'm making a small game similar to Super Hexagon. I've recently asked a question about making the game harder as the player progresses by increasing the obstacles' spawn rate. I was able to implement ...
1
vote
0answers
20 views

How to make a border teleporter from doodle jump

Right now I'm using this code, but the transition glitches from one border to another ...
0
votes
1answer
12 views

Equipped weapon does not appear in JSON data

I'm trying to make an RPG style game with equipment using ScriptableObject, but whenever I equip the item, it does not register in my JSON data. Here is the script ...
0
votes
1answer
22 views

make Shader Graph material flow aligned to the mesh UVs (like a river)

i need to add a flow effect to my river so that the water can flow along the path described by the mesh i created. Using ShaderGraph shader i added a time node ...
1
vote
1answer
80 views

Calculating new Velocities of split Physics Body

Given a Physics body with all his properties i want to break the body into two or multiple parts that keep the original velocities. for linear velocity this should be original velocity + centrifugal ...
0
votes
1answer
49 views

add force to object that has 2 different rigid bodies

I need add force to object that has 2 different rigid bodies and someone said that the best way of this is using fixed joint. The case is this ; I have player object and it has a pusher object that ...
0
votes
0answers
22 views

how would i make a sprite go in front and behind a 2d wall? [duplicate]

I've tried a few solutions but none seem to work. first, I tried adding half of that same sprite onto the original and then making the layer higher, which would work, except my original sprite can ...
0
votes
1answer
13 views

How to synchronize reads and writes to a StructuredBuffer across warps in HLSL?

I'm currently trying to implement smooth voxel terrain (using dual contouring) with mesh generation happening on the GPU and I'm struggeling with chunked level of detail creation. My approach is as ...
0
votes
1answer
39 views

How can I use offset to make the camera rotate around the player, but keep the distance from player?

The script is attached to the Main Camera. At the top : ...
1
vote
0answers
26 views

how to add a radius to an enemy using A* so it can only detect the player inside it [closed]

this might be a simple question but I don't know how to code very well and A* is confusing to me.
1
vote
0answers
10 views

Pink Objects/Sub-Meshes (NOT MATERIALS)

Using URP. Any object I import into unity from blender (fbx), the sub-mesh that comes with it are pink. All the materials are fine, I can put the object in my scene with a material and it looks normal....
1
vote
1answer
36 views

why isnt this playing a sound?

This code is supposed to play a sound when I press 'E' but it's not working. also keep in mind I'm new to unity and coding in general so don't be to harsh if I made a really dumb mistake. ...
0
votes
1answer
27 views

why isnt this pause menu code working?

the code when it works right should pause the game (which means setting the timescale to 0)when you press esc and bring up a pause menu. it does this, but when i press the menu button( which brings me ...
0
votes
0answers
17 views

Turning a flashlight on/off via SetActive

I don't know if this matters, but I'm using Unity 2D. The code only turns the flashlight off, but not back on. ...
1
vote
0answers
28 views

How to make the enemy only start pathfinding when player is within certian distance [duplicate]

Im using A* pathfinding and unity 2d. Also im very new and dont really know how to code well so if you can tell me the code it would be much appreciated. I figured out how to use A* but i dont want ...
0
votes
1answer
25 views

How can I make a menu item that splits animations based on a text file?

I want to split all the animations inside a FBX by using a .txt file which contains start times and names for the animations in this FBX. I found a script that does exactely that here. However, this ...
0
votes
1answer
28 views

How can I increase the spawn rate and speed after some time?

I'm working on a Super Hexagon-like game and the goal is to survive as long as possible. The game is working fine but I want to add a new feature that increases the spawn rate of the obstacles and ...
3
votes
1answer
77 views

How to make a custom 3d view cone that mixes orthographic and perspective cameras

I'm trying to make a camera that displays objects the same height no matter the distance, but still changes width relative to distance. Similar to having an orthographic view vertically and a ...
1
vote
0answers
76 views

How can I allow the rope to correctly interact with Box and Polygon colliders?

In order to build 2d rope physics in my game, I download the github project from Jongallant in this link. In my game, I want the rope to collide with objects with different types of colliders such as ...