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

In Unity, how do you manually set an interactable to an interactor (XR Grab Interactable to XR Socket Interactor)

I'm trying to figure out how to manually attach an XR Grab Interactable to a XR Socket Interactor but using XRBaseInteractor.selectTarget has the ...
1
vote
2answers
46 views

Reorientation when rotating Transforms around another Transform without parenting

The functionality I am trying to implement, consists of rotating one Transform and appling this rotation to other relevant Transforms in the scene. To make it a bit more clear: I have several objects ...
0
votes
0answers
24 views

What are Unity's subsystems used for?

What is the purpose of these classes? https://docs.unity3d.com/2020.3/Documentation/ScriptReference/UnityEngine.SubsystemsModule.html I understand generic subsystems in web development, is this the ...
0
votes
0answers
12 views

Can I bring the Game View window to front together with the main window on Mac?

I come from Windows environment and I was pretty fast with development and just working with Unity. When I clicked on the Unity icon on Windows to bring it to front, it immediately brought the Game ...
1
vote
1answer
98 views

Unity - How to create a game-save with a preview image?

I want my game-save to be shown with a preview image. This is often seen in City Builder games: The game-save usually has a name, a date and often also provides a preview of the build city (just a ...
0
votes
0answers
13 views

Allow Player controlled by NavMeshAgent to walk

I have a Player that I control using the thumbstick (or z/w/s/d), and I would allow this player to have walk and run. Now, My current code is the following for the movement : ...
0
votes
1answer
44 views
0
votes
0answers
33 views

InputSystem “Invoke Unity Event” don't respond to input

I was making the Input Systen code for my game. I was about to test it and I realized that the controls don't respond. Here is how I've configured my PlayerInput component: And here is how I've set ...
0
votes
0answers
15 views

Can I move the player with NavMeshAgent only?

I am making a prototype of a 3rd Person Controller for a minigame with Gamepad or Keyboard/Mouse (not point and click). I setup a terrain and NavMesh for my AI, and would like to use that NavMesh ...
1
vote
1answer
55 views

How do I make my obstacles (separate prefabs) appear randomly in the world?

I am using Unity in C# to code a game similar to Google's Dinosaur Run where random obstacles are spawned in the player's path which they need to jump to dodge. I have 6 different prefabs (with ...
0
votes
1answer
22 views

how does unity handle image scaling

Unlike in android SDKs, in almost all tutorials I've seen, creating UI elements like menus in unity starts with laying out a default background image onto a canvas object. I don't really get the fact ...
1
vote
2answers
38 views
0
votes
0answers
30 views

AddForce for sliding

So i'm making an fps game in unity c sharp, and i'm right now working on some sliding. Tho right now it just scales down and make me able to walk around, could anybody pls help with that Code: ...
0
votes
0answers
26 views

How to change control schemes?

I have been experimenting with Unity's new input system, but one thing I don't understand and couldn't find the answer for is how you change between control schemes. Basically, I want my game to ...
0
votes
0answers
64 views

Unity Easy Save 3

In Unity, I'm using Easy Save 3 to save and load data to a file in order to persist it between sessions. So far I've been using it in a more simplistic approach like: ...
0
votes
1answer
58 views

How to save / load a scene in unity? [duplicate]

I have 60+ levels in the game, that is, 60+ scenes. Let's say a player has passed to level 10 and leaves the game, then when he returns to the game , he will have to appear first on the MAIN MENU ...
0
votes
0answers
29 views

I cant finish my unity 2d trap because i keep getting "IndexOutOfRangeException" error

I got this error "IndexOutOfRangeException" and i can't solve it here's my code: ...
0
votes
1answer
59 views

Singleton issue [closed]

I have two scenes, The first one called "Boot" contains and ObjectPoller class that instantiates all GameObject in the game and disable them. I made it a singleton with "don't ...
0
votes
1answer
32 views

Switching out the mesh of a game object at runtime

I am trying to switch out the mesh of a game object. I have this script: ...
1
vote
1answer
48 views

Adding a shader graph material as a second material

I'm attempting to make an outline shader that I can attach to selected objects by following this guide. After making a new material and assigning the new Shader Graph as the shader, I'm not sure how ...
0
votes
1answer
15 views

How to fix : Cannot create a multipart form data section without body data

I successfully coded my game to register a player with their 'username, password, email' After Registering id like a player to fill in their username & password and have it checked by the db. Upon ...
1
vote
2answers
185 views

'WWW' is obsolete: 'Use UnityWebRequest'

I am creating a 2D MMORPG, I created a forum to store player information( username, password etc.). Could someone please help me understand the new Unity Web System so i can change my code for optimal ...
1
vote
0answers
9 views

How to make an AssetImporter that imports the image with the settings i want?

I need an automated system to import images(png,jpg,...) with the settings I want. for example, I need to import it as Sprite/UI or setting with the right resolution and right compression for each ...
0
votes
1answer
37 views

Why unity has shadowmask mode for light baking?

To bake a extra shadowmask map, what issue will be solved? Since subtractive mode also bakes shadow infomation into lightmap, why these two functions split? The extra shadowmask map is only for ...
1
vote
1answer
150 views

How to import images as sprites instead of default textures in Unity?

Basically, unity imports new images (png, jpg) as default textures but I need to import them as sprites instead. As there are lots of sprite sheet new assets in my game, it's time consuming to change ...
0
votes
0answers
43 views

Spawning noise-based fire effect with code, no prefabs

i'm a beginner in Unity, and I'm taking a Graphics course about algorithms of procedural textures/modeling. I would like to write a noise-based fire shader like this one: I would like to then be able ...
1
vote
0answers
30 views

Why when I move the transform closer to the target by dragging it in the editor in the scene view the target start stuttering and moving back?

The script is attached to a transform that move to a target and than when reaching the target the transform become child of the target. The script is working fine as it is now but if I drag with the ...
-1
votes
1answer
51 views

Could not find SyncVar hook

I've been following a guide on building a 2D MMORPG, and I ran into a problem when creating a health bar for my players. I get this error message: Could not find hook for 'CurrentHealth', hook name '...
0
votes
3answers
76 views

How do I keep the camera behind the player?

I am developing a Third Person Shooter. Until now, I had parented the camera to player. It would therefore automatically stay behind the player. Because this would not work well with Root Motion, I ...
0
votes
1answer
31 views

Why the AnimationCurve is not working with Lerp?

The main goal is to move an object to target with ease in out speed. The speed should increase at the start to max than near the target to slow down smoothly and stop at the target. At the top of the ...
0
votes
0answers
58 views

Unity RenderTexture Black when Saving PNG on Oculus Quest/Android

I've scoured the web for a possible solution to my problem with no avail. I'm currently trying to add a screenshot function on the Oculus Quest where a player can take a picture from a secondary ...
-2
votes
1answer
48 views

Returns an error : index was outside the bounds of the array

...
0
votes
0answers
44 views

Get C# code from Unity apk

This is the app I built using Unity. The current version of the app is 8. I was stupid enough to lose the code for version 8. Now, I only have code till version 7. This is the code which doesn't have ...
0
votes
1answer
25 views

How can I ease in and out of a Lerp motion over a set duration?

Here is the code I am using: ...
0
votes
1answer
32 views

Double jump help

I'm trying to make double jumps for my FPS game in Unity. I have written so that if I press "Jump", (the space bar) and that I'm not grounded, I will jump again and that I wont be able to ...
1
vote
1answer
20 views

Why when making a sphere child of a cube the sphere is losing his shape?

When I drag to the scene a new sphere it looks like a ball a rounded ball. When I drag the sphere to be a child in this case of a cube the sphere looks like ellipse. Is there any way to fix it ?
1
vote
0answers
19 views

Rigibody2D remove push-power

I have a player's prefab. The game is online, so when the player joins I place this prefab on the map. There are other players on the map. The player himself is controlled by Rigibody2D component ...
0
votes
0answers
8 views

How do you make a Unity 2D ball roll down a LineRenderer EdgeCollider2D incline?

How do you roll a 2D Image sprit ball using just the Unity builtin physics components on linerenderers with EdgeCollider2Ds? Tested my setup to work with physics. And PhysicMaterial2D so it bounces ...
0
votes
0answers
18 views

How Do I Get A Shader To Stop Glowing

I am trying to make a top down game. Sometimes the enemys are invisible to the camera if they go behind objects, and I want to be able to always see those enemies. I followed this tutorial to get to ...
0
votes
0answers
12 views

Particles look different in scene view and game view?

I'm rendering particles and I'm not happy how it looks in the game view. Why is there a yellow outline in the game view (right) instead of fading nicely into the background like the scene view (left)? ...
0
votes
0answers
19 views

How do I keep switching turns/states until a result is determined in unity?

I am making a turn based game and I want to switch turns after a user is done back and forth. I cant use update as it will restart the turn every frame. My code is: ...
0
votes
1answer
45 views

Unity 2020.3.15f2: Choose between VR and Desktop at launch

Lots of games have options for launching in VR or Desktop modes, either through steam launch options ("Play game", or "Play game in VR") or command line flags (...
-1
votes
1answer
70 views

How to complete a level and move on to the next level?

So, I need to load a different level when the user has crossed the entire level and collides (or triggers) a certain object. For that I have declared ...
0
votes
0answers
38 views

Using transitions and animating my human body such as getting up and walking

I'm pretty new to Unity and I need help. So my problem is: I have my human laying in bed, I press start the game and he starts walking, he ignores the getting up animation and goes straight to the ...
1
vote
1answer
55 views

How can I add a exit to the random maze generator?

This is the maze at runtime. There are some enterences/exists I didn't define yet what is enterence and what is exit. This is one problem to decide but for that I need some how to make at least one ...
1
vote
1answer
22 views

Root Motion: Where is left / right rotation coming from?

I am using a generic animation on a generic character (coming from Mixamo). The original animation does include root motion. However, the animation contains of a "straight forward" walk ...
0
votes
0answers
21 views

How to add turn based system like of snooker or pool game in unity2d? [duplicate]

How can I add a turn based system like a pool or snooker game in unity that waits for a player turn to be over before moving it to other player in local multiplayer? How can I determine when the turn ...
0
votes
0answers
30 views

Can I use Unity's free assets for commercial purposes?

i have a question, if someone is developing a game on unity for commercial purposes, can free or even paid assets be used in the game even if it is to sell the game? are assets not subject to ...
0
votes
1answer
18 views

How to count Score based on position of player?

So, I am making this game where you keep moving forward and there are obstacles in the path. If you collide with an obstacle 100 points are deducted and for every frame a point is deducted i.e. ...
0
votes
1answer
21 views

Unity Animator Ignoring "Higher" Layers

I have a rather rudimentary layer set up: Lower Body: no mask, full weight, override. Upper Body: upper body mask, full weight, override. This works as intended. Standing Up: full body mask, full ...

1
4 5
6
7 8
292