Questions tagged [unity3d]
Unity is a cross-platform game engine by Unity Technologies.
69,216
questions
0
votes
0
answers
4
views
My player is switching between animations when it is not programed to
When my player is moving, the animation switches between idle and walk when I am holding down D. I played the animation and it looks fine but when I play the transition it starts idle and switches to ...
0
votes
0
answers
10
views
VR: Put item in hand from List
I hope you are doing well.
So I am creating a VR with XR game in which I have a list of items as Scriptable Objects. Now I want to put one item in my hand when I press a button but I run into problems ...
0
votes
0
answers
14
views
constrain unity rigidbody to dynamically changing plane
I am making a physics based tank game, I need to keep the tracks (made up of many individual links, each with a Joint and a Rigidbody) on the guide wheels, I don't really know the best way of doing ...
0
votes
2
answers
19
views
disabling gameObjects after seconds using object pooling and coroutines
I'm developing a simple VR shooter in unity, i use object pooling for the bullets (Lasers here)
this is the ObjectPool script, here i istantiate a list of bullets in the start() method and disable ...
0
votes
0
answers
16
views
Playfab sdk error with Unity: error CS0246: The type or namespace name `ConcurrentDictionary' could not be found
So apparently i tried to make a project with multiplayer function in it, due to my current window version im using which can only run playFab to support for unity. Once i fnished my steps ( i've done ...
1
vote
1
answer
11
views
Change Button's Object via script
Is there a way to change the object via script? I've got 4 Npcs that they each have the same scripts in but different parent. right now I'm dragging the npc from editor but because of that the button ...
-5
votes
0
answers
28
views
Finding Some Good Unity C# Tutorials [closed]
So I just started unity and I need some unity tutorials to get started any suggestions.
Thanks,
Firestuff
1
vote
2
answers
17
views
How to stop cinemachine freelook camera rotation
I am working on a third person parkour game with new input system and cinemachine(Freelook). You move with the right joystick and look around using right joystick(Cinemachine Input provider). For ...
0
votes
0
answers
12
views
How to load model from network by Unity WebGL in run time?
How to load model from network by Unity WebGL in run time?
Any Code Samples?
I already get the bytes array of 'dae' files by UnityWebRequest,But how to load to prefab。
I'm trying to use Resources.Load(...
1
vote
1
answer
25
views
Unity - Callback when a package is removed but before recompile
I'm creating a Unity package I want to give to other people to help with translations. Currently, I only handle the Text component but I would like to handle TMPro too.
My idea is to create a ...
0
votes
0
answers
8
views
Legacy id not fetched. What should I do?
https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/GameKit_Guide/Users/Users.html#//apple_ref/doc/uid/TP40008304-CH8-SW6
I found a way to get teamPlayerId as ...
0
votes
0
answers
11
views
I am trying to build my first andriod game but I keep getting this error about the Android SDK, NDK and tools even after doing manual install
I am trying to build my first android game but I keep seeing this and getting a warning.
An Image of the warnings in my preferances in unity
I reinstalled the recent version of unity and also tried ...
2
votes
0
answers
18
views
Input.GetKeyDown doesn't work properly Unity3D
I have written a simple C# script for player jump(when i press the 'space' button a force is given to player). But it works like about 2 or 3 times for 10 attempts. What's wrong?
public float ...
0
votes
1
answer
31
views
Error Message says "Type or namespace definition, or end of file expected"
I'm not sure what's up with my code and please bare in mind I have just started coding. please help!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public RigidBody rb
...
0
votes
0
answers
9
views
Autoresize width of TextArea in Editor Window
I want to auto resize the TextArea containing the "Assets/" in my Editor Window for Unity.
I'm new to the whole Unity Stuff lol, so any help (Sources, Solutions or similar) would be ...
0
votes
0
answers
11
views
Issue in displaying closest POI to a user in Augmented Reality application
I'm developing an Augmented Reality application in Unity that continuously gets the user's current location and finds the point of interest closest to him. I've used the Firestore database to store ...
0
votes
0
answers
16
views
Get Assetbundle name before loading
I'm working on a project where the user can load assetbundles during runtime, so we only have limited control over what assetbundles are used. Because of that, we have to be careful when we load ...
0
votes
0
answers
22
views
can't add reference to solution explorer
I need to use a namespace called [system.windows.forms][1] in my C# file, while it tells me that "forms" does not exist in bla bla. I looked it up and found that it needs to be added from ...
0
votes
1
answer
19
views
How to differentiate between who sent the messages in the photon chat other than usernames?
So I have created a chat system for Multiplayer and it is working fine but I want a change in my UI so that player recognizes that messages were sent by other user or not. I have attached a picture ...
-2
votes
1
answer
35
views
The name 'MathfSign' does not exist in the current context [closed]
I have started to learn to code with this tutorial: https://www.youtube.com/watch?v=d3HEFiDFApI&t=124s&ab_channel=SebastianLague. I am in Unity version 2021.3.5f1 and am running on a 2d ...
0
votes
0
answers
14
views
firebase Realtime database paging with query
I am using Firedatabase with Unity3d.
My Issue is the user search for data, and I retrieve only 50 result each time,
It is easy to get first 50 record
Database.RootReference.Child("ID")....
0
votes
0
answers
22
views
How to make objects move like in Count Masters? Unity
How to make objects move like in Count Masters?
Here is the picture:
I thought and tried for a long time, but the objects sometimes stick together into an incomprehensible mess, or fly away under ...
0
votes
0
answers
22
views
Async Threaded SQLite queries in Unity?
I have been working with a codebase that has proven quite capable for working with SQLite databases in Unity. I have posted an example Unity project based on said codebase which demonstrates:
Async, ...
0
votes
0
answers
28
views
Is there any way in C# to find the corresponding function according to the function name, like python [duplicate]
In python, I can find the corresponding function with the function name like this:
### testa.py
def funca(a=0, b=1):
print("aaa", a, b)
def funcb(a=2, b=3):
print("bbb", a,...
0
votes
0
answers
15
views
Unity: need help exporting FBX model from android target at runtime
I have been working on a runtime FBX exporter for unity. It uses the Autodesk FBX SDK, which asks for you to have RUNTIME_FBX in the scripting define symbols of the project in order to be built and ...
0
votes
1
answer
31
views
Get the global position of a child object in parent
I need to get the child's position in global value by using the parents rotation and the child x position. I've tried:
planet.transform.localPosition
This gives the position on the x axis but not ...
0
votes
1
answer
17
views
How to create modular self contained components without repeat code in each?
I'm looking for a bit of direction on an issue I keep running into. I've recently challenged myself to code very granularly, so that small pieces of functionality can exist in a single component and ...
0
votes
1
answer
28
views
Handling server sending a lot of messages to a client
I am sending a lot of messages one after another in a loop with TcpClient and sometimes I seem to get all of the messages and sometimes only 1. When I send only one message it works correctly. It only ...
0
votes
0
answers
22
views
When I installed Unity, this window Requires me to register
I have a problem installing Unity. When I installed Unity, this window popped up. Requires me to register. But the problem is that the buttons are not pressed. Please tell me what to do?enter image ...
0
votes
1
answer
16
views
Canvas Image Turns invisible when scaled through C# unity
im trying to make a pokemon-like game and trying to make the healthbar out of images and scaling a green one, but when i scale it through c# it turns invisible
my code:
[SerializeField] GameObject ...
-1
votes
0
answers
21
views
Unity UI Bilder looks not like the game
I don't know why, but my UI Builder looks not like my game. :D
Can anyone help me?
Example:
On the screenshot are many labels and one gray and one black button.
[1]: https://i.stack.imgur.com/O8atE....
0
votes
0
answers
13
views
Unity GUI Editor Window update only while mouse moving in window
I'm creating tool, custom Unity editor window and I'm wondering if there is anyway to get some update function just when mouse position is in window?
void OnGUI(){
// Code from here only "runs&...
0
votes
0
answers
18
views
MotorBike MSK 2 kit Turning Radius Problem in Unity
I am working on Chopper Style Motorbike Simulation game and using the MotorBike Starter Kit (MSK) in Unity. I want to change the turning radius of my bike according to my game requirement. But In kit ...
0
votes
1
answer
26
views
Unity Instantiated Object doesnt have Values
I am trying to Instatiate Objects with the code attached but only the first Object has the Method awake called and doesent get any values out of orbitValues. The other Objects get instantiated but ...
-1
votes
0
answers
13
views
How can ı solve these Unity Error problems(hand presence)
**using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
public class HandPresence : MonoBehaviour
{
public bool showController = false;
public ...
0
votes
0
answers
36
views
Unity painting on render texture appears black on iOS build. Metal API
I am using paint in 3D. I'm trying to paint an object in 3d, It works like this: Ray hits the object and we get the vertex point around the hit point. Then we get UV points according to these vertex ...
0
votes
0
answers
11
views
Problem raycasting-based collision detection in Unity 2D, sprite in the 'actor' layer moves straight through the 'blocking' layer
Heads up: I'm quite new to Unity and wanted to try out its 2D features. Found a tutorial for raycasting and collision, and I think I followed it through and through.
Here's the code:
hit = ...
0
votes
1
answer
27
views
Move a GameObject to the previous position of other GameObject
I am trying to achieve something similar to the classic snake game, but, the player only moves one unit every time a button is pressed and the "tail (blue square)" needs to move to the ...
0
votes
2
answers
28
views
Cloning too many of the same object when pressing an object to replace instead of the other
I want to replace the broken table with a fixed table but when I press the button it places the table multiple times around the background. This is the script for the replacement.
using System....
0
votes
1
answer
36
views
How to improve a select query performance?
I am working on a method that basically takes an array of Color (Unity Type) as parameter and replace all colors contained in a list by another color contained in another color array.
For example you ...
0
votes
0
answers
20
views
OnEndDrag only runs every other time
I have imported ienddraghandler, and my other drag methods work just fine. However, my onEndDrag is activated only every other (end of drag).
Example: Grab Object, drag object from point a to point b, ...
0
votes
1
answer
28
views
How can I generalize these two coroutines so I only use one? (Input a boolean into the parameters and set from within)
I'm working on some script and I have the following two coroutines:
private IEnumerator blockTimer(float duration)
{
blocking = true;
yield return new WaitForSeconds(duration);
...
2
votes
1
answer
13
views
Serializable object is looking weird in the inspector
So I have this small class called StoryTrigger:
namespace VisualNovelScripting
{
[System.Serializable]
public class StoryTrigger
{
[SerializeField] public string triggerName;
...
0
votes
1
answer
33
views
Trying to make a video player with and List
I've made a an list with Videoclips, I noticed it's different to make than an array of audioclips which i made earlier. I tried different ways to code it but end up with no clues.
using System....
1
vote
0
answers
26
views
Unable to create instance of an object array [duplicate]
I have a class in which I'm storing deserilized json data, Here I have created an array object of that particular class. But whenever I try to store the data into that array object I get an error ->...
1
vote
1
answer
25
views
How to Object By name And assign the parent
I have some objects and I want to grab them Using C# and modify their Properties.
I know only the name of the Objects. This will allow me to assign the parent and much more
1
vote
0
answers
34
views
What is right syntax for try catch in unity? [closed]
i try to use this:
void Update() {
try {
a = b[1];
}
catch (IndexOutOfRangeException e) {
a = 1;
}
But unity gives me a error: error CS0246: The type or namespace name 'IndexOutOfRangeException' ...
0
votes
0
answers
25
views
How Can I Write Vector3.Slerp Function Manually?
I was trying to write my Slerp Method that uses Fixed Point Math. So, when I searching for Slerp Method in Google, I found another question something like this:
how does Unity implements Vector3.Slerp ...
0
votes
0
answers
11
views
Graphics.DrawMesh has wired offset while scaling in Unity, why?
I'm implementing after image effect currently and I meet a problem with Graphics.DrawMesh. The code shows below
public class AfterImage3DByCombine : MonoBehaviour
{
public class AfterImange
{
...