All Questions
Tagged with c# unity-game-engine
43,282
questions
0
votes
0
answers
3
views
How to instantiate and create a new GameObject with UdonSharp in VRChat SDK?
I'm currently writing a script in UdonSharp using VRChat Creator Companion and VRChat SDK to shoot a ball from my hand, but I get a compile error and cannot get it to work.
Is there a way to create a ...
-4
votes
0
answers
32
views
How can I edit my code so then my player will not just move vertically, when I want it to go horizontally? [closed]
When I played my game, the player moved straight up, with me being unable to keep control. Would it be fixed if I removed the code for vertical? And if so how would I change the code so no other ...
0
votes
2
answers
48
views
How can I fix my movement code? The player won't move correctly
I am new to coding and c#, but I have been trying to make my player without gravity affecting it. But my player keeps moving up and doing nothing else. I have started by trying to make it move to the ...
-1
votes
2
answers
39
views
Is there any way to check if a KeyValuePair<string, int> contains a specific Key in a Dictionary in one line?
In my code I have a Dictionary, which at first was just <string, int>. However, I needed a way for two things with the same string to be separate elements in the Dictionary, so I made the Key ...
0
votes
1
answer
29
views
Character does not move in Unity
I wrote the code in Unity hoping that the character can move in all directions in two dimensions if I press the direction key. (If I press the shift key, it moves fast.) However, after writing the ...
0
votes
1
answer
35
views
Unity 3D - Raycasts wont register in time if player has high enough velocity
hope someone here smarter than me can figure out my mistake.
I have a simple platformer game using raycasts to check if you’re standing on the ground. I tried colliders, but started using raycasts to ...
0
votes
0
answers
42
views
Maze in Unity - calculating shortest path and changing material
The problem seems to be that for some reason the ApplyMaterial only goes to the target cell and does not even try to change the materials of the other cells accordingly. I want the solver to find a ...
0
votes
0
answers
15
views
Singleplayer camera works, but Multiplayer camera not following and movements not synchronized between the clients
I am following a tutorial to make my Coursework and when I implement CameraTracking.cs it works on Singleplayer, but it doesn't work on Multiplayer. When create room and start the game the camera stop ...
-1
votes
0
answers
31
views
I can't understand why my raycast doesn't see my interactable object (key) but it does work with my interactable object (door)?
So the first thing I want to see is if my ray understands that my key is an interactable, but I do this via the interface, for example check if the whole object is type IInteractable and if it is run ...
1
vote
1
answer
31
views
How to create multiple independent spaces and run them simultaneously in Unity
I created a project using unity mirror assets.
I separated the server Unity project and the client Unity project.
Using the central processing server method, everything has to be processed on the ...
-5
votes
0
answers
37
views
How to set the falloffIntensity on a Light2D from a script?
I need to change the FalloffIntensity parameter, which script to access and how to do it?
I've combed through a lot of sites and either this information doesn't work, or I don't fully understand ...
0
votes
2
answers
36
views
How to make loading UI wait for level data to finish loading before hiding?
I'm developing a game where I load level data from a JSON file and instantiate objects and terrains (SpriteShape) based on the data. I'm using Unity with C#. My issue is that my loading UI hides ...
0
votes
1
answer
52
views
How can I force enable V-Sync in Unity?
I'm using Unity Engine. Some players turn off V-Sync in Video Driver Settings, which leads to very high FPS and overheating of the video card.
This code doesn't work:
QualitySettings.vSyncCount = 1;
...
1
vote
1
answer
41
views
ScriptableObject changes in Awake() not displayed in Inspector until after Unity restart
I've created a ScriptableObject class MySO that gets modified in its Awake() function. I also added EditorUtility.SetDirty(this); as its last command. The class has a List<someOtherClass> myList ...
0
votes
1
answer
27
views
Unity using Resources.Load in a Generic class
So i have multiple data types like armorData, weaponData, itemData etc and wanted to make a generic resource load for them (they are scriptable Objects) but apperently T or system.Object is not ...