76,996 questions
-1
votes
0
answers
32
views
HLSL URP 17.0 PBR functions do not render light
Unity provides their PBR lighting function with UniversalFragmentPBR, and UniversalFragmentBlinnPhong, but for me, it doesn't seem to render the light.
I have been following a couple of books on ...
0
votes
0
answers
40
views
Mobile game Test version is not visible on any android device. ( Unity- Android)
I recently started working on a Unity mobile game (Android). I upload my builds to Google Play Console for testing and share the test link with my testers. They can install the app from the Play Store ...
Best practices
0
votes
3
replies
61
views
How to not write a Firestore Converter for each type. (Firestore + Unity / C#)
I am using Firestore and Unity, I want to be able to serialize a Unity class, say Vector2Int so I write a Vector2IntConverter(FirestoreConverter<Vector2Int>).
When I upload my DTO, say:
[...
-6
votes
0
answers
66
views
I can't move while jumping in Unity
using UnityEngine;
public class PlayerLocomotion : MonoBehaviour
{
PlayerManager playerManager;
AnimatorManager animatorManager;
InputManager inputManager;
Vector3 ...
-6
votes
0
answers
33
views
AdMob App Open Ad overlaping Interstitial and Rewarded Ads before they are closed [closed]
So im using Admob AOA, Inter and Reward ads in my Unity game project but the problem is when Interstitial or Rewarded ad is displaying, if i clicked on it to navigate to the ad page and return to the ...
-3
votes
0
answers
73
views
How to avoid bullets shooting off-center when aiming through a sniper scope camera? [closed]
How do you handle this typically?
My Main Camera is in default position at my players head. My SniperScope Camera is positioned either at the end of the scope lens or at the guns muzzle, which I got ...
1
vote
0
answers
38
views
How to check for possible collisions using gizmos
I am making a clone of the game "Arrow Out." I am not sure if this is even the correct way but I am thinking of using gizmos to check if there is another arrow in the path of the clicked ...
Advice
0
votes
2
replies
43
views
Better AI Behaviour
I am currently working on AI Behaviour in a Beat-Em-Up game in Unity for my beat-em-up project, I am currently using my own statemachine system (with states that don't inherit from monobehaviour) to ...
0
votes
1
answer
59
views
Firebase causing Unity Android build to fail
======
cocoapods-1.16.2
Unity 6000.0.41f1
Firebase 13.4.0
OSX 15.5
ISSUES:
Android: not building
> Could not resolve all files for configuration ':launcher:debugRuntimeClasspath'.
> Could ...
-1
votes
0
answers
24
views
Unity initiate issues
In my Unity Project when my game runs my world item prefab initiates sprites that don't show on my inventory display only the canvas that can't be seen on screen and it doesn't spawn any collectable ...
-3
votes
0
answers
35
views
Script on a parent gameobject being triggered by a trigger attached to a child gameobject [closed]
So my issue is that I have a parent gameobject with an OnTriggerEnter script, and said script is being triggered when entering a trigger that a child gameobject has. The child gameobject has no ...
-2
votes
0
answers
47
views
I have an issue with input action assets [closed]
Basically I'm trying to write a simple player movement script using input action assets. However, once I press one of the buttons (WASD) and hold it down, the player moves in the correct direction, ...
0
votes
0
answers
30
views
Unity 6 - Android - HTTPListener
I am trying to create an HTTP listener in my game application to be run on Android.
I have created this script that receives API requests from the network and do some stuff in the game.
using ...
Advice
1
vote
1
replies
47
views
Looking for a better way to handle animation trigger calling in Unity using a Blend Tree and object instantiation
I'm fiddling around with a 2D side-scroll game using C# in Unity. Basically, I have a method that gets called when I hit an animation trigger on the animator and that method instantiates a GameObject (...
-1
votes
0
answers
42
views
Unity Prefab Type Mismatch
I have tried for days to troubleshoot but only met with persisting Type Mismatch.
I am working on a flappy bird game and i wanted to make the pipes go faster as the score increases so i made a [...
-1
votes
1
answer
36
views
Unity UWP build: “A scripted object probably BlankScene has a different serialization layout” when using [SerializeField]
I'm encountering a serialization error when building a Unity project for UWP and running it in Visual Studio:
A scripted object probably BlankScene has a different serialization layout when loading (...
0
votes
0
answers
68
views
Counteracting recoil without moving return vector
I've implemented basic FPS recoil (code shown below) and currently, the player can counteract the recoil climb by pulling the mouse down, but when the recoil returns to zero, the player view is at a ...
0
votes
0
answers
49
views
How to make a player stick to a planet while moving?
I actually make a game about a space explorer but i've enconter a problem. When my player hit the ground (or when he spawn on the surface) he slide on the back of the planet. How can i actually make ...
1
vote
0
answers
51
views
Displaying a coordinate grid and markers on the globe in Unity
Please help me with the Earth model in Unity. I don't understand what's wrong.
I downloaded the blue marble texture from the NASA website, attached it to a Material, and placed it on a sphere.
I want ...
0
votes
0
answers
38
views
Vuforia 11.3.4 error — ARTrackablesChangedEventArgs not found when using AR Foundation 5.2.0 (Unity 2022.3)
I’m working on an AR project in Unity 2022.3 using Vuforia Engine 11.3.4 and AR Foundation 5.2.0.
When I try to build or play in the editor, I get the following compile error:
Library\PackageCache\com....
Best practices
0
votes
4
replies
105
views
How to properly implement target requirements in game?
I'm a self-taught beginner learning through trial and error. I'm working on a card game in Unity (C#), and I'm trying to design a clean and extensible system for validating targets during gameplay.
...
Advice
1
vote
0
replies
70
views
Text-to-Speech function in a 3D Unity game
I am doing a 3D game using a Unity, and I need my NPC can communicate with the players with voice
I want my NPC can speak with a voice that response is generated by the LLM, so the response will ...
1
vote
1
answer
79
views
Saving Movement Data as a CSV File in VR Headset (C#/Unity)
I'm working on a project where I want to collect movement data (X/Y/Z position and rotation) from a VR headset (a PICO Neo 3 Pro Eye) using a C#/Unity script, and export it as a CSV.
I have a script ...
0
votes
0
answers
63
views
OnMouseDown() not working — object not destroyed on click [duplicate]
I created a square GameObject named "Target" and added a Box Collider 2D component.
Then I wrote the following C# script:
using UnityEngine;
public class ClickToDestroy : MonoBehaviour
{
...
0
votes
1
answer
104
views
I can't figure out why the enemies are spawning outside the rooms
I've been trying to fix this issue with my code for a while now but I can't seem to figure it out. For some reason, the enemies can still spawn outside of rooms, but they won't ever spawn outside of ...
0
votes
1
answer
96
views
I need help fixing this crouching bug
I'm currently struggling to understand why the crouch mechanic isn't working all that well in unity. I would be grateful to anyone who can help me understand why this code doesn't work and how can I ...
2
votes
1
answer
70
views
Tracking a button works once, but when I click it a second time, nothing happens
In Unity, I have an idea for a simple game where, if a child object collides with an object tagged "wall" and presses the W button, the parent object moves towards the collided object. ...
2
votes
0
answers
66
views
FMOD Error in Build: "Cannot create FMOD::Sound instance" - AudioClips Fail to Load (Works perfect in Editor)
I’m currently developing a Full Motion Video (FMV) game which, by its nature, contains a very large number of video and audio clips. I’ve encountered a critical issue that only appears in the built ...
0
votes
1
answer
85
views
unity android dependency resolver is stuck at 0%
image resolver is stuck at 0%
Running Gradle...
E:\game project\spaceFighterMobile\Temp\PlayServicesResolverGradle\gradlew.bat --no-daemon -b "E:\game project\spaceFighterMobile\Temp\...
2
votes
1
answer
70
views
Assembly-CSharp not loading when I open my Unity scripts written with C# in Visual Studio 2022
When I open my Unity scripts in Visual Studio 2022, I am greeted with this error:
I tried deleting all .csproj files before opening in VS and also tried reinstalling VS and Unity. The file being ...
1
vote
1
answer
97
views
PlayerPrefs won't update between simultaneous players
I am currently developing a WebGL app with Unity and using PlayerPrefs to try and make it so that a unique user id is generated for a player and used to connect to a remote lobby system.
The problem I'...
0
votes
0
answers
39
views
iOS Widget Extension Provisioning Issue with Unity Cloud Build
I have a Unity package that creates a iOS widget extension with its own Bundle Identifier. Everything builds and runs correctly when I build locally from Xcode, but when I try to build using Unity ...
2
votes
1
answer
132
views
How to query Firebase Realtime Database for top N users and current user’s rank
How to index Firebase Realtime Database for leaderboard and get current user’s rank?
I’m using Firebase Realtime Database to store user data for a game. I want to implement a leaderboard based on the ...
0
votes
0
answers
112
views
How do I construct an Il2Cpp string?
Using Il2CppDumper, I have dumped my files and am perusing the methods and their arguments using dnSpy. Some methods take string arguments like this one:
[Token(Token = "0x6000338")]
[...
0
votes
0
answers
54
views
Rigidbody not moving on start even though capsulecast not detecting anything
I want to implement basic movement using a rigidbody but my player at the start of the game cant move using WASD and can only jump and shift. When they shift, they slide to the side a bit before WASD ...
0
votes
0
answers
34
views
Android project using untiy-classes.jar (generated by Unity) with some classes that can't be resolved
I work on a small android project that uses the unity-clases.jar generated by Unity. Some (not all) of the files/classes in the .jar can't be resolved when compiling the android project and I don't ...
-4
votes
1
answer
72
views
Unity 6 keeps giving me error from cs.meta file [closed]
Unity keeps giving me error from cs.meta file to change the language version from c#9 to c#10 or greater because of feature "global using directive", how should I change the version or what ...
0
votes
1
answer
96
views
Make a floating point origin in unity
I created this code in Unity to only move the object in my scene if the threshold is exceeded, but it does not set my tracking object, and continues to snap to it. My tracking object was a rigid body ...
0
votes
0
answers
62
views
How to check if gameobject with Rigidbody and a Physic material doesn't move in Unity3d in C# in another script?
game engine : Unity3d 2021.3.17f1.
programming language :C#.
Windows 10
Hello, I create a football like game in Unity 3d. How do I check that a game object with a Rigidbody component and a Physic ...
0
votes
1
answer
74
views
VLC for unity trial version, the type or namespace name 'LibVLC' could not be found
I'm trying to test the free trial version of VLC for Unity, the package was downloaded here https://videolabs.io/store/unity/
I imported the downloaded "vlc-unity-trial-v6.unitypackage" in ...
1
vote
1
answer
75
views
Bluetooth LE Device Connects Then Immediately Disconnects on First Attempt
I'm developing a Unity application that connects to custom ESP32-based Bluetooth LE joysticks on Android. I'm experiencing a consistent pattern where the first connection attempt fails with an ...
1
vote
0
answers
47
views
Cinemachine follow camera stuttering if the target object to follow rigidbody gravity is disabled. how to make the camera follow smooth?
when using gravity, it's working fine the camera is following smooth.
when gravity is disabled, the camera is stuttering. and i tried in the Rigidbody to set the Interpolate property to Interpolate ...
0
votes
0
answers
55
views
Unity Fusion Network Transform Jitter
I'm making a multiplayer game using Server/Client mode in Photon Fusion 1 in unity where players dogfight with their planes.
Now the issue I'm facing is when I attach Network transform component on ...
0
votes
1
answer
47
views
Can't use DOTS in unity 6.2
I wanted to study using ECS for a new project. But after I imported them using the git urls provided by the official site, i ran into some error messages:
here are the packages i have:
I have ...
0
votes
0
answers
97
views
Installing Onnx package broke all python dependencies
I followed all of the instructions in this video and installed al the the proper packages on top of Python 3.10.0
https://www.youtube.com/watch?v=v1d7SinTzEY&t=1s
pip install torch torchaudio ...
1
vote
1
answer
89
views
How to freeze a player so that he does not move to one side
How can I make it so that the player cannot move, even through physics, in one direction?
I tried this option:
using UnityEngine;
using UnityEngine.InputSystem;
public class Player: MonoBehaviour
{
...
1
vote
0
answers
62
views
Render Texture Triangle From Vertexes and Uvs
I'm attempting to render out part of a spritesheet to a new standalone texture. I have the triangles, vertexes and uv coords of my sprite but my code only correctly renders the first triangle not the ...
0
votes
0
answers
43
views
How to show GBK encoded header in Mac version Unity editor properly?
I work on my project on both Mac and Windows. Some editor headers were written in Visual Studio on Windows in Chinese, and were encoded in GBK(default I guess). However they don't show properly on mac ...
-3
votes
1
answer
56
views
How to change spacehip's axis from Z to X? [closed]
You can see that the player rig has the axes bug not the prefab
I have added 0.5 to the current position
I was doing a unity course(Game Dev.Tv) and I happen to know that my Z axis is not correct. ...
0
votes
0
answers
37
views
Android XR Unity player Cannot access 'constructor(p0: Context!, p1: B!, p2: IUnityPlayerLifecycleEvents!): UnityPlayer' it is protected
I am building and app for Android XR and I am using Unity to build 3D text. My final goal is to allow user to set text in textfield in Jetpack Compose UI, save it to Firestore, fetch it and display 3D ...