We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

3

I recommend always asking about your goal, rather than the method you think might help you achieve your goal. ie. "How can I draw a rectangle over 3D content that's in front of it in HDRP?" rather than "How do I draw a world rectangle as GUI?" This avoids the X/Y problem, helping you get the outcome you want without distractions or unnecessary constraints. ...


3

The tutorial, "Ruby's Adventure: 2D Beginner" is a 3D project. I restarted the tutorial and changed it to 2D using the menu "Edit -> Project Settings... -> Editor -> Default Behavior Mode". Next, I followed Cedric Degottex's suggestion in the comments for the tutorial by opening "Window > Package Manager", and installing the "2D Sprite" and "2D Tilemap ...


2

Answer I figured it out: there's absolutely nothing wrong with changing the direction of your rigidbody's velocity. The problem was using transform.up to rotate the game object itself. I replaced that with rb.MoveRotation(rb.rotation + angle) and it's buttery smooth now. Takeaway In general, if there's anything I've learned from this project, it's that ...


2

You're trying to limit double-counting using your results list: if (result.Contains(neighbor)) { continue; } result.Add(neighbor); The trouble is, you're using a different result list in each iteration: We call FindAllRecursiveNeighbours with bubble A's position. We make a new result list for A, and find all A's neighbours, including bubble B. Bubble ...


1

Okay so the goal is to be able to rotate a rectangular, which I'll call sprite, to line up with an arbitrary point in 2D space, which I'll call target. Rotating sprite to line up with target can be achieved through the Transform.LookAt method provided by Unity, however this alignment will be based upon sprite's center, and we would rather have the target ...


1

I made a custom toolbar. I uploaded it in my github


1

In the updatescore method you simply ask, whether isGameActive is true or not.


1

The thing is that you look for neighbours and then you call the same method again on the neighbours, which means that you can find the origin again, as well. This causes an infinite loop meaning StackOverFlow in this case. It might make more sense to find a clever way to give each Bubble an Array or List of Bubbles (Neighbours) and set them during the level ...


1

If you need the Image enabled during the process but also do not want it to 'receive input' you can get a reference to the image and disable the Raycast Target. Then re-enable it when you need it. If you never want it to be selectable you can just uncheck the box in the bottom right. image.raycastTarget = false;


1

In a case like this you would either want to make that a public GameManager gameManager or add a [SerializeField]above the variable and simply drag it to the slot to set it. If you would like to keep it private you could either use a Gameobject.Find(); or something like FindObjectOfType() to set that manager in Start() After assigning your manager when ...


Only top voted, non community-wiki answers of a minimum length are eligible