r/UnityHelp • • Apr 10 '22

Lighting Intensity Issue with Lumen

2 Upvotes

First project in Unity and I'm using the starter HDRP project. I removed the starter assest and imported my own. Tutorials I am watching are setting the lumens on spotlight to around 50. I am not getting any visual light from the spotlight until I crank it up to around 500,000 lumen. Any idea what this issue could be?


r/UnityHelp • • Apr 03 '22

ANIMATION blender to Unity animation bug

2 Upvotes

The issue is that each time I import a blender animation to unity, it gets messed up. I've been struggling with this issue for over 2 months. I don't know what to do. Can someone please help me?

I export with fbx


r/UnityHelp • • Mar 31 '22

Project darker in iPhone build.

2 Upvotes

Hello, I have a Unity 3D project using version 2021.2.8 on an Apple silicon. My project looks beautiful with lighting all nice and bright within the Unity editor, but when I build my project onto Xcode and run it on my phone, the whole scene is much darker. Has anyone encountered this before? It is like the illumination went down by 50%. Here are my player settings.


r/UnityHelp • • Mar 17 '22

Quads in unity.

2 Upvotes

Sorry for my noob question but i'm working in a little game "endless runner" so i just created 2 quads with the ground and background material with the speed animation scripts and it works prefectly but the thing is that im setting my player to run right and i gave him a speed but he can quit the ground n background scene i want him to run "right n left" freely but inside the ground scene without passing it.


r/UnityHelp • • Mar 07 '22

LIGHTING Baked lighting is abnormally bright in-game (not in Unity, oddly)

2 Upvotes

I'm making a modded map for a game. It's a generally low poly forest map (no foliage for now) as well. I followed a modding guide for setting up the lighting to the T. When I bake the lighting, it looks perfect in Unity, but the moment you load it up in the game, it's almost pure white. I've tried everything, but it always gives the exact same result. What's the issue?? I'm losing hope.....


r/UnityHelp • • Mar 07 '22

Player death reference issue

2 Upvotes

When my player dies the game crashes with an error saying there is a missing reference exception, The problem is coming from the script below which references the player, I have tried many solutions and I was wondering if anyone has any ideas, thank you.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyMethod : MonoBehaviour
{
    [SerializeField]
private float speed = 1.5f;
    [SerializeField]
private GameObject player;
public int damage;
public float distance;
public LayerMask whatIsSolid;

// Start is called before the first frame update
void Start()
    {
player = GameObject.FindGameObjectWithTag("Player");
    }
// Update is called once per frame
void Update()
    {
Swarm();
    }

private void Swarm()
    {
transform.position = Vector2.MoveTowards(transform.position, player.transform.position, speed * Time.deltaTime);
RaycastHit2D hitInfo = Physics2D.Raycast(transform.position, transform.up, distance, whatIsSolid);
if (hitInfo.collider != null)
        {
if (hitInfo.collider.CompareTag("Player"))
            {
hitInfo.collider.GetComponent<Health2>().TakeDamage(damage);
            }
        }
    }
}


r/UnityHelp • • Mar 04 '22

PROGRAMMING I need help starting assembly / disassembly system

2 Upvotes

I am interested in making a system similar to World of Guns, where you disassemble / assemble models such as toy cars. But I am stuck on where to start.

For instance I have a model which has all the individual parts, I have a system in place for interacting with each individual part ( gives a model name, and details ) but I am completely stuck on where to go next.

The aim is to build a model plane / car and then paint & add stickers to the models. Any help would be greatly appreciated

Edit: if you've ever built an Airfix kit you'll know what I mean, I want to bring Airfix kits into the gaming world as this is all I did as a kid. And I would love to make a game where you have all the Airfix kits ( I know this is a big undertaking but I love Airfix )


r/UnityHelp • • Feb 27 '22

Are Unity sprite masks performance based on mask count or overall sprite count?

2 Upvotes

I'm building an indoor outdoor system where when inside a house the rest of the map will fade to black, but still within world space.

In order to accomplish this I will require a spritemask over the entire scene, when the player is "Outdoors" and will swap to a number of smaller spritemasks while indoors (only one spritemask is active at a time).

But I want to make sure its reasonably scalable before implementing it heavily.


r/UnityHelp • • Feb 25 '22

Almost certainly a dumb question (About types)

2 Upvotes

So, its been a night. Trying to get some data saved for a project to a Firebase Database. Everything is going fine as far as writing is concerned, I've gotten that working several times! I can write a nice organized database, or json some data and wedge it in there, or a combo of the two... But no matter what I do I can't seem to get my variables to reliably come out of the same type they went in!

I've tried casting everything as a float, double and an int, I started off writing Json Data for most of the data with a few other bits elseware in the database, but I could never get the json to come back out parsed how I put it in... and every time I tried to edit it in code the need for {s and the like messed me up (yeah, I'm kinda dumb, I'm sure thats a workable problem for smart people...)

Anyway, halp, please? I'll share some of my horrible ass code if ya want, but I suspect I'm doing this so wrong it won't really matter.

TLDR, Got like 100+ numeric variables (I can make em whatever god darned type we want as long as their bloody implicitly whatever its called...), and a firebase database, how I make store/load? Yes, their in a serialized class(or three, I've done both this week).


r/UnityHelp • • Feb 24 '22

WSAD movement + Jump code Fix

2 Upvotes

Hi, could someone help me, how to improve my code? When my character jumps, its doesnt move forward at the same, how to rewrite the code to make it work properly? I would like it to be possible to walk forward or to the sides while jumping as well. Thank you.


r/UnityHelp • • Feb 13 '22

UNITY New to unity, trouble with scene, scaling and camera

2 Upvotes

Hello, I'm a programmer trying to get my hand on unity just for the fun on creating smale 2D games. I used this tutorial to get going with a project: https://www.youtube.com/watch?v=qWDQgmdUzWI

My project is now a bit bigger, I added menu and things like that. While its working correctly for now, I Feel like I don't understand at all how my scene and cameras work together. My main game scene contain the space invader, and the camera is located to the very bottom left corner of the canvas object I use to display button and other info such as fps in game. However, when I start the game, the two works fine together and the button is where it should be, even though when looking at it its outside of camera. So all in all, wtf is happening Im lost? Here are two picture, maybe they will be more telling: http://prntscr.com/26v1ygm http://prntscr.com/26v1yl5

TL DR: project works, but I don't understand the fundamental of why it works.


r/UnityHelp • • Feb 09 '22

Cursor spins every second while in the editor

2 Upvotes

Brand new project, no editor scripts running at all and my game is not running. Every second my mouse cursor spins like something is happening (compiling scripts, etc) and stops after a split second. It's also lagging my machine because when I run my game (a ball lerping across the screen) I get frames dropped around when the cursor is spinning.

I found some thread from back in 2017 where someone was having this issue because Unity was recompiling excessively. Apparently the issue was resolved in a patch so it does not really help me much with my situation.

Has anyone seen this? Any resolution to suggest?


r/UnityHelp • • Feb 07 '22

Camera help

2 Upvotes

I am making a game for my finals project for school but I ran into a problem that I don`t know how to fix. This is my first unity project so I am a beginner. But here is the problem I am making a 2D game and need the camera to be able to move I got that part down now I added a HUD that displays your recourses but when I zoom with the camera the HUD gets zoomed too and goes outside of the players POV how do I lock it so it stays in place? I tried some things like having 2 cameras but I couldn`t make that work I tried making the HUD a UI element 2 but nothing changed pls helppp


r/UnityHelp • • Jan 30 '22

PROGRAMMING Movement Script Troubles

2 Upvotes

I have a simple crouch and sprint script written here along with my movement script, but if I press shift/ctrl it will do what it’s supposed to but then it will stay stuck that way. Like when I press left shift it speeds up but if I let go it stays sped up. Same applies to the left ctrl. Please help.

Thanks in advance!


r/UnityHelp • • Jan 17 '22

ANIMATION Error Whenever I Try to Export Animation

2 Upvotes

Hey Y'all.

Currently, I'm facing some issues with FBX exporter in Unity. I'm trying to export an anim using it, but I get the "NullReferenceExceptions: Object reference not set to an instance of an object" error message every time I try to export. Can somebody help me?


r/UnityHelp • • Jan 11 '22

Curved Progressbar

2 Upvotes

Hi everyone! I have looked around on the internet, but i couldn't find a solution. Is there a way to make a curved Progressbar? Not a full circle just a curve If someone could help i would apreciate it!


r/UnityHelp • • Nov 22 '21

Editing prefabs in Blender3D ?

2 Upvotes

Hi, After I create my 3D models and drag them into scene, I can still open them from the project window, edit them and the edits will be applied to the model in the scene, right? What about, making a prefab out of the model in the scene and then seeing the changes to the 3D model in the prefab as well when changes being made. Is that possible? How? Thanks a lot.


r/UnityHelp • • Nov 19 '21

UNITY I have no idea what I am doing and I need help please.

2 Upvotes

I started an udemy course for game developing, specifically "Become a Game Designer the complete series. Coding to Design". I am very much a beginner and haven't used any similar types of programs since I was in high school.

I'm not sure how familiar anyone is with this course, but lesson 16 "Importing the 3D Game Kit" is where I got stuck. After I imported the 3d game kit, I'm supposed to click on an object in the assets list to populate the hierarchy and load in level one, but the object isn't appearing in the assets list. Did I do something wrong? How do I fix it so I can continue the course?


r/UnityHelp • • Nov 07 '21

PROGRAMMING Why isn't my hitbox working? I want its collider to only turn on when the player hits a specific key in air, and to be able to break this rock prop I designed.

Thumbnail
gallery
2 Upvotes

r/UnityHelp • • Nov 04 '21

PROGRAMMING i am trying to make a 2d game and i cannot sort out the attacking thingy

2 Upvotes

just realised i forgot to take a photo imma put one on my profile if u need to see it


r/UnityHelp • • Nov 03 '21

PROGRAMMING Coding Terminal Velocity For A 3D Character Controller

2 Upvotes

Okay, I am making a 3D platformer, and I want to code it so that the character has a terminal velocity, i.e. her maximum fall speed is a set value. I've set gravity at 9.81 m/s^2, or Earthlike, but I want to know how I can set terminal velocity, preferrably around 55 m/s. Here's my code:

  1. using System.Collections;

  2. using System.Collections.Generic;

  3. using UnityEngine;

  4. using UnityEngine.InputSystem;

  5. public class PlayerMovement : MonoBehaviour

  6. {

  7. CharacterController character;

  8. float moveX;

  9. float moveZ;

  10. float moveY;

  11. Vector3 movement;

  12. private Vector3 rotation;

  13. Vector3 velocity;

  14. public float speed;

  15. public float gravity;

  16. public float rotationSpeed = 180;

  17. public float crouchSpeed = 8;

  18. public float jump = 10f;

  19. bool isGrounded;

  20. public Transform groundCheck;

  21. public LayerMask groundMask;

  22. public float groundDistance = 0.2f;

  23. public float highJump = 62.5f;

  24. void Start()

  25. {

  26. character = GetComponent<CharacterController>();

  27. //cameraTransform = Camera.main.transform;

  28. }

  29. void Update()

  30. {

  31. isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask);

  32. if (isGrounded && velocity.y < 0) {

  33. velocity.y = -2f;

  34. }

  35. this.rotation = new Vector3(0, Input.GetAxisRaw("Horizontal") * rotationSpeed * Time.deltaTime, 0);

  36. Vector3 move = new Vector3(0, 0, Input.GetAxisRaw("Vertical") * Time.deltaTime);

  37. //this.jump = new Vector3(Input.GetAxisRaw("Jump") * jumpSpeed * Time.deltaTime, 0, 0);

  38. move = this.transform.TransformDirection(move);

  39. this.transform.Rotate(this.rotation);

  40. character.Move(move * speed);

  41. //this.transform.TransformDirection(this.jump);

  42. if (Input.GetKey(KeyCode.Z))

  43. {

  44. character.height = .75f;

  45. //character.speed = 8f;

  46. character.Move(move * crouchSpeed);

  47. if (Input.GetButtonDown("Jump") && isGrounded)

  48. {

  49. velocity.y = Mathf.Sqrt(highJump * -2f * gravity);

  50. }

  51. }

  52. else

  53. {

  54. character.height = 1.5f;

  55. //character.speed = 10f;

  56. character.Move(move * speed);

  57. if (Input.GetButtonDown("Jump") && isGrounded)

  58. {

  59. velocity.y = Mathf.Sqrt(jump * -2f * gravity);

  60. }

  61. }

  62. character.Move(movement * speed*Time.deltaTime);

  63. //if (Input.GetButtonDown("Jump") && isGrounded)

  64. //{

  65. //velocity.y = Mathf.Sqrt(jump * -2f * gravity);

  66. //}

  67. velocity.y += gravity * Time.deltaTime;

  68. character.Move(velocity * Time.deltaTime);

  69. }

  70. private void FixedUpdate()

  71. {

  72. }

  73. }

What's the fastest way I can code for terminal velocity?


r/UnityHelp • • Sep 21 '21

PARTICLE SYSTEMS 2D collision triggering particle emmision.

2 Upvotes

I'm making a 2D game about a guy that flies around and punches asteroids for points. I'm trying to set up the system where the player colliding with an asteroid causes a blast of particles and the asteroid to be deleted.

I've been at it for two days and watched every applicale tutorial and made no progress. I'm ready to ask for help. I've deleted all the code for the particles so I can start again.


r/UnityHelp • • Sep 14 '21

Content in scroll view goes too high when scrolling down

2 Upvotes

When scrolling down in my scroll view, the bottom of the content does not stop near the bottom of the screen. Instead the content will continue until it is near the middle of the screen, and can be higher or lower depending on the screen size of the device the application is built to. How do I fix this? Any help would be immensely appreciated. I have tried to find a solution but like many of my issues with Unity, the solution is likely right under my nose.


r/UnityHelp • • Sep 01 '21

PROGRAMMING Assets\mouselook.cs(34,45): error CS8124: Tuple must contain at least two elements.

2 Upvotes

I am following a tutorial ( https://www.youtube.com/watch?v=_QajrabyTJc ) and i keep getting error CS8124, here is the code I have written. https://pastebin.com/c0jVQPgQ