Normal view

There are new articles available, click to refresh the page.
Yesterday — 9 May 2024Unity Forum

DOTS development status and next milestones - May 2024

Hello, all – the DOTS team is here to share our next DOTS roadmap update!


What is DOTS?

Unity's Data-Oriented Tech Stack (DOTS) is a combination of technologies that work together to deliver a data-oriented approach to coding. Our goal with DOTS is to empower creators to build more ambitious games with Unity and serve their needs in the production of complex multiplayer, crossplay, and open-world games.

DOTS consists of several packages based on the Entity Component...

DOTS development status and next milestones - May 2024

How to get a object to rotate around another while still looking at a other

Im wanting my enemy's gun to rotate around the enemy but still focus on the player.
I have already tried to add a offset to the gun but it just hangs out next to the enemy and rotates toward the player not rotating around the enemy to the player. There are no errors in the code but when it is set to the enemy position it messes with some of the hit boxes and I havent been able to find any tutorials online to help with this specific problem.


Code (CSharp):
  1. public Transform player;
  2.     public...
How to get a object to rotate around another while still looking at a other

One finger touch but got fingerId 1

Hello, I am trying to output all Input.touches in each frame. In the case of a quick click with only one finger, I obtained a touch with fingerId 1 and also a touch with fingerId 0, with a time difference of 1ms or even 0. Sometimes use two fingers can also result in some touches with fingerId greater than 1. I want to know if this is because some touch lifecycles have not yet fully ended, and if there is any solution. Thank you!

NetworkRigidbody2D always kinematic

I recently updated to the latest version of Unity and I'm not sure why it would cause this but now my NetworkRigidbody2D components are always setting rigidbodies to kinematic whether or not the client/host owns the rigidbody. In singleplayer and in multiplayer, and I haven't changed anything to do with that recently and it suddenly stopped working just today. Previously it worked as intended and set it to kinematic on clients that didn't own the rigidbody and it didn't effect the...

NetworkRigidbody2D always kinematic

Process.Exited event works but functions do not call

Hi, I have the following code:

Code (CSharp):
  1.  void StartAC()
  2.     {
  3.  
  4.         GameRunning_UI.SetActive(true);
  5.         var GameProcess = Process.Start(new ProcessStartInfo
  6.         {
  7.             FileName = Acs_exe_path,
  8.             WorkingDirectory = AcRootDirectory,
  9.         });
  10.  
  11.         if (GameProcess == null || GameProcess.HasExited)
  12.         {
  13.             UnityEngine.Debug.LogError("Failed to start game process!");
  14.             return;
  15.         }
  16.         GameProcess.EnableRaisingEvents = true;...
Process.Exited event works but functions do not call

Roslyn Analyzer for Unity package

Im currently working on a package that provides a framework, and want to write some custom DiagnosticAnalyzers for the correct usage of it.
Ive written a few for non-Unity projects before, so my question is not about the analyzers themselves, but rather about how to best integrate them within a Unity project.

As far as official documentation goes, this page is all I could find.
On there, they suggest you build the analyzer...

Roslyn Analyzer for Unity package

ProBuilder 5 vs ProBuilder 6

Hi all! Here is a complete comparison video of ProBuilder 5 vs ProBuilder 6, to help everyone change workflows. I get the friction there, but once you've tried this mixed with a few other toolsets, I think you'll love it!

Please let me know if you'd like any extra details, or if you are an Asset Store developer who would like help making your toolset equally integrated with the new Contextual Tooling system!

Custom Spotlight Calculation not working

Does anyone know how the inner spotlight angle for a spotlight in Unity's built-in render pipeline is calculated (since I can't set them manually)?

I fake spotlights with a custom shader based on billboards. The shader calculates the lighting like this:

Code (csharp):
  1. float3 IncomingLight(float3 surfaceNormal, Light light)
  2. {
  3.    return saturate(dot(surfaceNormal, light.direction) * light.attenuation) * light.color;
  4. }
  5.  
  6. float GeneralAttenuation(float normalizedDistance)
  7. {
  8.     // return saturate(1.0 /...
Custom Spotlight Calculation not working

Player walks through stairs in build, but walks up them like it should in the Unity editor

In my Unity editor when i walk on stairs it just goes up the stairs but when I play the build game the player walks through the stairs. Do any of you know how to fix this? This is the script I use for walking up the stairs.

"
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class StairClimb : MonoBehaviour
{
Rigidbody rigidBody;
[SerializeField] GameObject stepRayUpper;
[SerializeField] GameObject stepRayLower;
[SerializeField] float...

Player walks through stairs in build, but walks up them like it should in the Unity editor

I want to disable all alert errors for webgl

I want to disable the entire alert system that shows up with:
An error occurred running the Unity content on this page.

I'm using unity 2022.

I tried disabling the alert in a unityloader.js file I found in the webgl build folder but that didn't work.
I also tried this but it didn't work either. I cleared my cache in my testing also.
Code (CSharp):
  1. UnityLoader.Error.handler = function(e,t){console.log(e);}
I'm not sure where it's even coming from in 2022.
Can someone tell me where...

I want to disable all alert errors for webgl

Setting custom icon for file extensions using ScriptedImporter

The ScriptedImporter class is a welcome change. However, I'd like to have assets with a particular extension to have an associated icon - instead of the default Unity3D one. Is that possible?

It would be nice to have that wrapped into the ScriptedImporter attribute similar to this ...

Code (CSharp):
  1. // Custom importer for *.foo files
  2. [ScriptedImporter(1, "foo", "Assets/Path/To/Foo/Icon.png")]
  3. public class FooImporter : ScriptedImporter
  4. {
  5.     // Importer details ...
  6. }

Build Multiple Display

My project is developing an apps on windows using multiple display. One problem is that I use Touchscripts so I can only use 1 target display is display 1. So I use viewport rect to divide each display part onto canvas with dimensions of 9600x1080.
And I use 6 screens with the setting order on windows being 4, 6, 5, 1, 2, 3 and of course 4 is the main display. I think when activating all display in unity and when building the app, it will run starting from screen 4 and spread evenly to the...

Build Multiple Display
❌
❌