#archived-code-general
1 messages Β· Page 163 of 1
Also instead of doing [SerializeField] GameObject _idleParticles and then GetComponent<ParticleSystem> you should just do:
[SerializeField] ParticleSystem _idleParticles;```
no
an instance in the scene would be fine
it seems like you're referring to a prefab from the project folder
I'm only doing it this way because I use the _idleParticles gameobject seperately
then you can do _idleParticles.gameObject π
but whatevs
What are you dragging into _idleParticles, in the Inspector?
does anyone know why Directory.CreateDirectory(Path.GetDirectoryName(fullPath)) seems to think the directory already exists even if the capital letters are different? (for example, it will write in the directory named "tesT" rather than create a new directory called "test")
On what operating system?
windows 10
even if visually the folder can use capital letters?
yes
See if you can even create two folders in the explorer that differ by capital letter
This is what happens when I try to do that on my Macbook
π€―
thats not windows ofc
i cant see my gizmo
how do i fix it
can anyone help me w this
Have tried for a couple hours, every lightmap on every object in my scene is full black. The scene itself is lit, but all the lightmaps are black
what stupid thing am I doing
Like the scene gizmo?
in the top right of the scene view are gizmos enabled? Is this a custom gizmo or something?
uncheck 2d π
The gizmo is used for 3d navigation. It disappears when the 2d button is toggled on
that's not true
That circle looks like it may be from the "Rect" tool (used for UI), which tool do you currently have selected? (should appear in the top left of the Scene window by default)
That might be why you are not seeing gizmos, that tool is meant for Canvases/UI, try switching to the 2nd from top, which should be the 3-arrows you showed earlier (the hotkey for that I think is W as well)
oh i thought they were talking about the 3d thingy
damn this still aint working
Looks like the gizmo is working to me, which gizmo are you looking for?
are you actually zoomed in enough to see it?
The gameobject might be empty (no Renderer), assuming that isnt a parent
doesn't matter, it will still show the gizmo they selected for it
provided they aren't zoomed out hella far
has anyone messed with the idea of merging sprites?
wait one sec
let me try make another project
cuz i did mess w sprites
yo can i stream to u?
cuz it aint even working in a new unity
how would one go about making sprite animations for ui elements since you're not able to use the SpriteRenderer component?
it works with other game objects
That's Coroutines, not Tasks
Use the image component. Not a coding question.
you can animate an Image component. but also #πβanimation and/or #π²βui-ux because this is a coding channel
I was wondering if unity had one for specifically Tasks that serves the same purpose
await Task.Frames(5)
Etc
What are you expecting to see specifically? When you say "other game objects" do you mean like a Cube or something specific?
thought i would have to make a custom script - why i asked in the coding channel
unity only just got proper async support in the 2023 version. but you can use the static methods on the Awaitable class to await specific unity things
https://docs.unity3d.com/2023.1/Documentation/ScriptReference/Awaitable.html
on the bottom is a spirt rendere
on the top there is a empty game object
idk why its not giving me a gizmo for the top
at this point you should probably post your issue in a relevant channel with all of the relevant info all in one message
Aha! Exactly what I was looking for.
await Awaitable.NextFrameAsync();
only works in 2023 though
i think they just got support for Task in new 2023. should be a method in the new doc stuff . . .
Yeh I'm on latest stable 2023.whatever
Easy enough to make a static extension that is something like Awaitable.NextFramesAsync(n); with that method existing
This one I am curious about, I wonder what it's ramifications are
https://docs.unity3d.com/2023.1/Documentation/ScriptReference/Awaitable.BackgroundThreadAsync.html
do unity acc hates me i go to the help section to let them know my problem and it fixes itself
les go
was the empty game object suppost to be the child of the camera????
it wouldn't need to be just to see the gizmo. i use empties with gizmos on them quite frequently to mark stuff like attach points, spawn positions, etc and have never needed to do anything special to be able to see them. even when they have no parent object
my unity must be buggin cuz i cant see it when it is out of the camera's heirarchy
Hi, weird question, but why do I only have input field tmp and not input field?
you do have the legacy one, but use the TMP one instead
it's Betterβ’οΈ
use the correct type. also !code
π Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/
π Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.
the type for a TextMeshPro UI object is TMP_Text or TextMeshProUGUI (the latter inherits from the former)
Is there a list of bot commands somewhere?
Thank you.
This is some code we got with ChatGPT,
https://hatebin.com/eblvpmkjso
but it gave us this error:
NullReferenceException: Object reference not set to an instance of an object
TMPNameTransfer.StoreName () (at Assets/Scripts/Chapter 0/NameTransfer.cs:35)
Sorry, I'm completely new with Unity. Trying to help Fiance with her uni project. So I'm a bit lost with this all.
it is against server rules to get help with AI generated code
oh, my bad. Sorry.
you can review this if you need help with that exception though: https://unity.huh.how/programming/common-errors/runtime-exceptions/nullreferenceexception
and #π»βcode-beginner next time. NREs are pretty much always a beginner issue
is doing 'LoadScene' in an async function essentially the same thing as doing 'LoadSceneAsync'
asking because i want to get the referance to the scene
Can anybody tell me what's goofing up the code to make it go backwards?
public class Slingshot : Manager, IDragHandler, IBeginDragHandler, IEndDragHandler
{
public Camera m_cam;
public GameObject objectInSling, holder;
Rigidbody babe;
public Transform slingMid;
Vector3 slingPos;
public float power = 10f;
void Start()
{
//m_cam = Camera.main;
babe = objectInSling.GetComponent<Rigidbody>();
babe.isKinematic = true;
if (m_cam.GetComponent<PhysicsRaycaster>() == null)
Debug.Log("Camera doesn't have a physics raycaster.");
}
public void OnDrag(PointerEventData eventData)
{
Ray R = m_cam.ScreenPointToRay(Input.mousePosition);
Vector3 P = R.GetPoint(1f);
P.z = 0.1f;
Vector3 pN = slingMid.position - (slingPos - P);
Debug.Log(pN);
holder.transform.position = P;
}
public void OnBeginDrag(PointerEventData eventData)
{
Ray R = m_cam.ScreenPointToRay(Input.mousePosition);
Vector3 P = R.GetPoint(1f);
P.z = -0.1f;
slingPos = P;
Debug.Log(slingPos);
}
public void OnEndDrag(PointerEventData eventData)
{
var.slingSlung = true;
Vector3 slingStuff = (holder.transform.position - gameObject.transform.position) * power;
babe.isKinematic = false;
babe.AddForce(slingStuff, ForceMode.Impulse);
objectInSling.transform.parent = null;
}
}```
I want it to only be able to be pulled back
probably flipped a value somewhere
Hello! Does anybody know if there's a way to get the closest point on a bounding box from within the bounding box itself? Using ClosestPointOnBounds from a point within a collider just returns 0.
π Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/
π Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.
this is a code channel
then show your code
that wouldnt help you
lmao because this isn't a code issue. it's an issue with changing your build settings.
but that option that is greyed out is likely influenced by whatever platform you have selected
could someone tell me what i am trying to jump on the ground but it wont let but then when i go to the side ofo a block it has me jump
don't crosspost. stay in #π»βcode-beginner and show your code
i get an error when building that in xcode that the functions arent correct
hey boxfriend, where can i find the discord for the c# book you told me about?
on the book's website
How do i setup a proper achiteture to deal with animation triggers?
For example, i do have my playerController
public class PlayerController : MonoBehaviour
{
public Animator animatorFoo;
private void Move()
{
//Do move...
animatorFoo.SetTrigger(1);
}
}
Its usually the way i do to trigger animations, but it does not respect SOLID principles. What's the proper way to setup this? Tried doing using Observers, but it messes up with my state machines.
(reposting since I forgot a few details in my first post)
Trying to modify and 'improve' a dungeon generating algorithm to fit my needs.
The algorithm as it currently stands works like this:
-
Place a starting module and add it's exits to a list (pendingExits)
-
For a certain amount of iterations, go through every pending exit and place a new module at them. Exits define which type of module can be attached to them (i.e. only a "room" type can be attached or only a "corridor" type can be attached)
-
If the new room doesn't overlap anything, add the new module's exits to the pending exits list (skipping if it finds no room that doesn't overlap anything when placed)
The changes I want to make are:
-
Allow a way I can force there to be only a certain amount of a specific type of module placed(so I can define 'special' module's which only appear once or twice throughout the generated dungeon)
-
Remove the iteration based generation and replace it with something that guarantees the amount of module's generated
How can I modify the algorithm as it currently is to achieve this?
You want to use a Backtracking Algorithm with Constraint Propagation such as the WaveCollapseFunction. (You probably have an equivalent or close to be) You can define whatever you want as a constraint.
Your problem is a Constraint Satisfaction Problem (CSP) if you want more information. It is well documented.
im honestly really suprised at how well this is keeping my attention, and its also an amazing resource to look at when you need to know how something works
hi, so i already create earth map that pin point some country like japan, how to set "look at" for spesific country?
I've tried WFC for this kind of thing but it seems like WFC works best and is most easily implemented for grid-based stuff. My modules are arbitrarily sized (thought will always be axis-aligned).
My main issue right now is it generating stuff like this.
Nothing can be placed on the remaining junction exits (left) and nothing can be placed on the exit of the curved corridor (right)
The only solutions I can think of are recursive in nature, i.e. don't place a corridor if nothing can be attached to it's exits when it's placed, and then also do that check again for whatever can be attached to that corridor
hiya. I have a TextMeshPro element where I'm trying to change the colour of individual words. I'm updating the colour32 elements and calling UpdateVertexData, but nothing is happening on screen. I can't see any missing steps from the handful of examples online, does anyone know what to do? I can change all of the text tint at once, but not individual quads.
My base colour is white so it should be working as multiplicative, right?
Why not use rich text?
hadn't heard of it until now, is it part of textmeshpro?
Rich text documentation for TextMesh Pro.
yeah, you're getting a significant step up in difficulty when moving off of a grid
chur thanks π
You'll quickly run into problems with runtime, since that's an enormous search space.
with rich text is it possible to get word screen position so that individual words can be linked to clicks?
yes it does
not sure, I'm pretty new. I'll look for that too, thanks π
Pretty sure I mentioned this before π
#π²βui-ux message
I'm so mad. this took 5 minutes to set up, but I'd spent a week kicking around vertices under the impression that was the only way. thanks google
more than a week
MAD
thanks everyone
Yeah you put me on to text mesh pro but I didn't know all the details π
Hi all, for the A* Pathfinding Project by arongranberg, how do I update the node's tags to add penalties? I've tried using a GraphUpdateScene component with the modify tags setting but it doesn't seem to be working for me
how do i return a tuple of enums?
Same way you return a tuple of anything
Enum randomDrink = (drinkBase: randomBase, drinkSyrup: randomSyrup, drinkTopping: randomTopping);
i think im doing it wrong somehow
Yeah, why are you assigning that to Enum?
ohh i see
the reason i did that is because i didnt know what variable could store it i guess?
See https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/enum for how to define an enum in C#
these are 3 diffrent enums for an object
You want vertx's link then
though I recommend simply creating a custom struct or class for this
tyty yall
https://hatebin.com/pcgnocpukq
Hey, question about decisiontrees here -
I'm currently making a nodebased tree, but I'm not fully sure how it works (the guy who was teaching me didn't fully explain it).
In particular, I don't actually think/know that the code I have in the link shows if the tree actually knows how to go to a specific branch in the node. I also don't know if I should be adding the leaf nodes to the nodes with checks on them, (pardon the nodes at the very end, I've yet to add them to any existing nodes as children).
If someone has answers, please ping me/ping reply, thanks in advance. I can provide clarification on specific things as needed, but otherwise I've tried to snip it down to the relevant parts.
is there a wrap operator like %= but for when numbers go below a threshold?
example?
% is a remainder operator btw
a % b gives you the remainder when a is divided by b
dk if you remember this, but you gave me this code earlier to change the hue values of a material's color
h += Time.deltaTime * 2f;
h %= 1f;```but i want to do the same for saturation, except some objects are glowing outlines and their values need to be reversed from the rest of the object's saturations
yes
to achieve a flashing pattern
it kind of works here, however the outlines of the blocks are out of time with the insides
shouldn't it just be s = 1 - (sOfTheOtherThing);
[Range(-1f, 1f)]
public float glowSat = 0f;
void Update()
{
renderers.ForEach(r => {
float h, s, b;
Color.RGBToHSV(r.material.color, out h, out s, out b);
if (r.gameObject.tag == "outline")
{
//if (s >= 0.01f) s += Time.deltaTime * 2f;
//if (s > 1.49f) s = 0.01f;
s = glowSat;
}
r.material.color = Color.HSVToRGB(h, s, b);
});
}```why does the saturation not update whenever i mess with the slider in the inspector?
is the game running?
Do your renderers have the "outline" tag? (btw you should use CompareTag)
yes and yes
i get this fun thing in consoleFormatException: Input string was not in a correct format. System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) (at <492e64214f0c42f2b51bf2d39219ebe6>:0) System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) (at <492e64214f0c42f2b51bf2d39219ebe6>:0) System.Int32.Parse (System.String s) (at <492e64214f0c42f2b51bf2d39219ebe6>:0) BubbleSpawner+<>c.<Update>b__8_0 (System.Char c) (at Assets/Scripts/BubbleSpawner.cs:34)
Looks like an error at Assets/Scripts/BubbleSpawner.cs:34
you are trying to do int.Parse with an invalid string
oh
Can I also ask why you're using the lamda ForEach instead of a normal one?
because i come from java and its engrained in me
is there a downside using it here?
there's a downside in Java too π
Creating a delegate is unecessary
Some people decided in Java 8 that regular for loops were an antipattern and that's a damn tragedy.
alright well the int parse thing was a bit unrelated, just accidentally put some extra stuff in a config
i still cant get this saturation thing to update
oh its not updating
changing the slider doesnt update the variable in the script
what's with the NRE in your video?
NRE?
NullReferenceException
that was this i believe
should be fixed
that's a different error
well im not getting it now
if i have this slider script attatched to the prefab of an object will it not affect all instances of it?
at least during runtime
absolutely not
each instance has its own independent internal state
that's why they're called instances
the only time a copying happens is when the objects are first created:
- when the scene starts
or - when you Instantiate the prefab
for some reason when i change the brightness of an object with an emissive shader on it, it loses the glow
Do you mean Bloom postprocessing?
bloom is based on the brightness of the pixels relative to the rest of the image
it needs to be brighter than the rest of the screen by a certain (configured) threshold to be affected by bloom
ah ok
but i thought brightness gets capped at 0-1
whenever i set the slider to 1, it still doesnt bloom
yeah the threshold is 0.75 right now
whats the record keyword used for
Modern .NET when π
I want to convert a string to UI text and I want to insert a new line in the text, I am editing this string in the inspector and tried using \n but this just actually writes \n into the text. Is there any way for me to put a new line into the string through the inspector ?
Are you using TMP
Unfortunately no because i am working on an older project, but if its necessary, I could just go and replace the text with tmp.
cuz if you are then make sure rich text format is enabled on the text object and use <br> instead of \n
yeah no Im using legacy text
so do I have to switch to TMP or is there any way to do it with legacy text
Just press Enter
you can also do:
[TextArea]
public string MyString;``` to get a better editor for it
Pressing enter doesnt do anything if its a string in the inspector
alright I can try that
it does if you use TextArea
Yeah that worked perfectly, had no idea you could do that, thanks for the help
Is there any way to use an Assembly Definition file exclusively as a auto-namespace (or any other way to setup auto namespaces in Unity), or would the best solution be to inject into the AssetPostProcessor and check "if script file, re-import with desired namespace" or create a custom editor window to essentially create "script templates" that already have the namespaces I want? I have a "Assets > Scripts" folder organized into sub-folders for each feature of my game and my end goal is to be able to create new C# scripts, and already have the class nested in a "namespace ..." for them, is there maybe a common approach for this?
if you're creating your script files in the unity editor just set the root namespace setting in the editor project settings
Oh interesting, didnt know that existed - im guessing that would be globally? So it wouldnt matter where in the project a new script file is created it will always use the same root namespace?
yeah
Ah perfect, thatll help a lot then, thanks
if you want it based on folder structure you should create the files in your IDE. you just have to make sure to set up whatever the relevant settings for that are (i cannot remember what they are off the top of my head and it will also likely depend on the ide you use)
I use Visual Studio (2019, and sometimes 2022 but I dont think the version would matter too much), would these be like "templates" or some keyword I can lookup in VS to do that?
I may have found something, though looks like ill have to mess with XML and file systems, might have to look into it further, thanks for the insight btw
Is anybody using or have used MakeContentAppearAt? https://github.com/Unity-Technologies/arfoundation-samples/issues/950
The documentation includes a link to a sample extension method how to retain that method but the link is dead.
I have a question. What is Mathf.PerlineNoise range of definition? In other words, in what range do the x and y parameters need to be?
Between Single.MinValue and Single.MaxValue
Anyone have any idea if you can code for unity to throw a warning? Like the yellow "!" ones not the red ones
Debug.LogWarning
I tried that and it seems to be the same as debug.log
are you sure you were looking at the right one, maybe you have a duplicate message from another debug.log or didnt save the script
I believe I was but Ill try again
Unity crashed while trying to reload from saving the codeπ’
You were right haha
Thank you
can't wrap my head around this: I have a static Initialize() function in a script that i need to run before any Start() functions in the scene... is there an easy way to do that?
If you spawn an object and want to pass data to it, calling initialize after spawning it should work fine
collecting references to manager scripts, and i need to do that before the managers actually use them in ther start()s
Awake() does the job for now, thanks!
hello guys, does anyone know how i can get the volume of the microphone?
How do I make this script load a different scene and unload the current one?
LoadSceneMode single automatically unloads the current scene
the current line doesn't do anything
Let's say I have a component that is in an Editor folder. When I make the build, that component would not be part of that build, right?
Yes, unless you have assembly definitions in place.
then have you checked at which line does it fail by Debug.Logging?
could be that OnTriggerEnter doesn't get run at all. Or it didn't pass the Tag check
or the number of unlocked levels
most likely
then check
the collission never registers
I see, I googled it, and if I create a platform-specific assembly definition, it should work as expected, right?
https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html#create-platform-specific
(Just want to double confirm)
Yes, an asmdef that only exists in editor should work.
This editor is not configured. Please configure it first before getting help.
If your IDE is not autocompleting code
or underlining errors, please configure it:
β’ Visual Studio (Installed via Unity Hub)
β’ Visual Studio (Installed manually)
β’ VS Code*
β’ JetBrains Rider
β’ Other/None
*VS Code's debugger plugin is unsupported.
We recommend using VS or Rider instead.
i have a bullet spread system, it takes two angles (right and up) and adds them to the camera forward rotation to get the direction for raycast, but for some reason when the forward rotates, the 20 on the x starts inverting, coming to become -20 in the 180 angle. How can i stop that from happening? Quaternion temp = Quaternion.Euler(20, 0, 0); Debug.DrawLine(transform.position, transform.position + (temp * transform.forward*5), Color.blue); this is test code but it has the same issue
it also does nothing at angle 90, it just stays at zero, it looks like the x value is being passed through a cos function
it has something to do with absolute values and global coords
i just cant pinpoint why it fails
help me here
euler constructed there is absolute offset
which should work properly with a local Vector3.forward
transform.forward is a worldspace vector
the problem happens when you try to rotate the global forward by local euler
so what happens is, the rotation flips gradually when going from z+ to z-
but isn't Vector3.forward just 0,0,1 how is it influenced by an object's rotation? Or is that some quaternion magic i don't understand i still have no idea how those things work mathematically
yes if it was local coords system, Vector3.forward would be local
but since its global, there is no local, and you already have a world vector in transform.forward
How could I get OpenFracture to work with my custom mesh? It's a very simple mesh. 6 points 8 faces. An extruded Triangle.
I use a MeshCollider for the collisions, which I have tested for physics and it's exactly what I would expect. But when I use OpenFracture, no Mesh is assigned to the fracture objects.
ok so i did some random things with code and stumbled upon this solution Quaternion temp = transform.rotation * Quaternion.Euler(val, 0, 0); Debug.DrawLine(transform.position, transform.position + (temp * Vector3.forward * 5), Color.blue); it works... for some reason, i really don't understand how, or what's changed but it does, not complaining tho
here
var offset = Quaternion.Euler(20, 0, 0) * Vector3.forward;
var rotation = transform.rotation * offset;
Debug.DrawLine(transform.position, transform.position + transform.forward + rotation, Color.blue);
oh you came to the same solution
haha
it works because it avoids using transform.forward
builds a local rotation, and adds it to current world rotation
makes sense
my guess is there is some "math loss" in the process of using already "final point" world forward to compute something
skill or mmr based?
different things
MMR based I guess? Like trophy system
Ok thank you
void OnTriggerEnter(Collider other)
{
if (effect != null) {
effect.Play();
}
Debug.LogError("coll");
Destroy(missile);
}
how i can add delay after effect.play
coroutine
ty
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CRASHMISSILE : MonoBehaviour
{
public GameObject target;
public GameObject missile;
public ParticleSystem effect;
private IEnumerator WaitAndPrint(float waitTime)
{
while (true)
{
yield return new WaitForSeconds(waitTime);
}
void OnTriggerEnter(Collider other)
{
if (effect != null) {
effect.Play();
}
coroutine = WaitAndPrint(2.0f);
StartCoroutine(coroutine);
Debug.LogError("coll");
Destroy(missile);
}
void Update()
{
}
}
}
btw if you just want to destroy something with time, Destroy method has adelay parameter on it for seconds
!ide
If your IDE is not autocompleting code
or underlining errors, please configure it:
β’ Visual Studio (Installed via Unity Hub)
β’ Visual Studio (Installed manually)
β’ VS Code*
β’ JetBrains Rider
β’ Other/None
*VS Code's debugger plugin is unsupported.
We recommend using VS or Rider instead.
coroutine was never defined. Bu yeah you should config your editor if it didn't catch the error
you ddin't need to copy and paste the whole code without understand how it works lol
Hi everyone, I spent this yesterday but didn't get a reply so thought about asking again. Does anyone know if there is an easy way to render handles on top of gizmos? I'm using draw line to render some debug data for a level generator in the editor, and I'm also using handles.label to render some text in regards to this. However the text is always rendered behind the draw lines. Is there a way to change this?
in which callback you are rendering handles?
what does this code do
what is effect.play
OnDrawGizmos
Should handles be placed else where?
generally bad idea, create a custom inspector or better an editor window for your tooling and use SceneView callbacks
SceneView.duringSceneGui
SceneView.beforeSceneGui
Ah thank you!
I'll see if I can find some docs on when SceneView is used so I understand this all a bit better, thanks!
its a wrapper around the viewport in editor
Can someone help me understand why my update method isn't repeating the threshold check? It works the first time, but once the main function ends, it doesn't repeat the process like I want it to. It just starts the record again, but I want it to wait anch check the threshold until it's exceeded again. It seems like it might be holding a value and just restarting automatically.
you are basically on a trip down editor extension highway
so brace for a lot of info
did you run debugger?
It looks like you are setting loudness = 0; but that variable is unused according to your IDE. Are you expecting scaledFromMicrophone.Loudness to change when you do that?
hello. im trying to implimante crouching into my rigidbody charachter controller and it works like this :
when the crouch key is pressed change the players scale to 1,0.5,1 then move the player up by '0.875f' so the camera does not change its position and the player drops down on the ground. but for some reason the player only moves up by '0.875f' some times. not all the time. whats the problem here?
there is #shader
but it belongs to Graphics but computing shader, has nothing to do with graphics :/
i'd try #archived-code-advanced
ok thanks
good to know.
hiiiiighway to hell!
i need to get into that a little more
Hello guys, has anyone been faced with a problem regarding Screen.width and height values as well as the safeArea values?
I am seeing some weird results in the Simulator as well as the Android builds. Anything I find online says it has been fixed in an earlier version of Unity but it doesn't seem that way.
Screen.width (in editor) seems to be the size I put in Game tab, not the actual screen size of the simulated device.
And in a packaged build, it's also not the right values (Safe Area is bigger than Screen.width and height)
I believe so? Full disclosure, Iβm doing something very complicated with basic coding knowledge and GPT supplementing that lack of understanding.
When the program starts, I have a threshold check which I confirm using a visual object which scales with mic input. It works until the process completes, then it doesnβt scale anymore until the function is restarted manually as opposed to via threshold.
No, honestly, donβt know how to use it. Iβm not really much of a programmer, just understand how to piece things together.
If you accept messages from non-friends you share a server with, I'm willing to try and help you out a bit
Since this involves scripting api stuff, I chose this for tilemaps. Basically, I'm doing a raycast on a tilemap, and I want to get a bunch of information about that specific tile, but its Sprite in particular. How should I go about doing this? I'm pretty sure my raycast grabs the whole tileset if it succeeds..
This is still an issue if anyone knows!~
proly open an issue on their git repo instead and you'll get a much reliable answer from the devs there
Ohhh good idea, thank you! β€οΈ
Is there an EventSystems interface that would allow me to click and drop UI elements? I need the same thing that IDragHandler does but instead of dragging things, i want to click on them and then click where i want them to drop.
You just need to maintain your own little state machine
e.g. track if you are currently in the "waiting to drop" state
and handle that on the next OnPointerDown
Let me update that. Done
Hello! So i have a very simple and direct question but cant find a way to do it in any of my research.: So I love this zipback project and use it in allll of my projects now, https://github.com/mukaschultze/unity-zip-backup - The only thing I want to change is that when it creates a zip file of the project, I would like it to put the contents into a folder with the name of the project before making it a zip file. Right now it just puts the backup folders (assets etc.) directly into a zip file without being contained in a folder. ANY help appreciated
I'm working on dynamically loading scenes via triggers, and I wonder what is the purpose of setting the active scene?
Is there a function like GraphicRaycaster.Raycast but that returns the first element hit by the raycast instead of a list of elements?
how would one play an animation over a given amount of time?
Hello! I want to rotate red object on collision so its top face always be turned to the surface. How i can do that?
For example, you can check if it's transform.x is bigger than than the transform.x of the white object. If it is, then you know the red object is to the right of the white object, so you rotate the red object by 90 degrees. Understand?
are you using rigidbody physics?
yes
Actually gonna need to compare redcube.x with (whitecube.x+whitecube.width/2)
I would create trigger collider boxes with a script I make that has a serialized vector made public.
OnTriggerEnter of the player Id check if the other object has that component, and if so change the players gravity direction to be said components vector value.
I understand but your solution works fine only when white objects are always square
Id maybe also create a circle one without any value, and instead use OnCollisionStay2D or whatever its called and continously point their gravity vector towards the center of the circle collider
Oh I guess you could also add a float for gravity strength too
(to said component)
gravity isnt problem on collision I disabled rigidbody and set object parent to the white object
Id also rotate/tween the object to point its "bottom" in the same direction of the gravity vector. I believe "Face Towards" or something like that is what you want
Finally you'll need to swap controls around depending on the rotation ideally, which is a fair bit of work but feels pretty slick once you get it working
What othe shapes are you working with?
slopes
typically a "pull to center of circle" field + a rectangle "pull in uniform direction" field are enough to handle 99.999% of use cases
Oh actually no, you may also want a "push away from center" one
If the center is of uniform distance from every point on the surface then you would be right. Otherwise, this won't work (which I think is not the case for this guy).
Thats what you use the second one I stated for
You use "pull to center" for convex curves.
You use "Push from center" for concave curves
and you use "Uniform direction" field for straight lines
!collab
oh hm, bot is ded?
I tried setting red object transform.top to collision.contacts[0].normal but it changed object proportion
?
read the rules
You just need to rotate the object to point in same direction as the aformentioned gravity field I talked about earlier
I dont even understand what gravity field you talking about
#archived-code-general message
#archived-code-general message
#archived-code-general message
Youd want 3 "types" of "gravity field" prefabs built the way I described here, 1x rectangle "uniform direction" field, 1x "Pull to center" circle field, and 1x "Push from center" circle field
I hope someone here can help me, I have made a character in Blender and gave it ShapeKeys (called BlendShapes in Unity) which all function perfectly in Blender, however when I change the values (weights) in unity, it only works when the game is not running. So I can use the BlendShape sliders to let my character blink, but if I want to change the value, use the slider, or change value through code all while running the game, it does not work.. I have tried to find solutions but haven't found anything. I stumbled across a comment from 5 years ago that said to export the FBX as ASCII, and then it should work, however this export is not an option anymore in Blender. Hopefully someone has a solution.
Hrrrm, do namespaces break Editor scripts?
Assets/Scripts/ShowOnlyAttribute.cs:
namespace Assets.Scripts
{
public class ShowOnlyAttribute : PropertyAttribute
{
...
}
}
Assets/Scripts/Editor/ShowOnlyDrawer.cs:
using UnityEditor;
using UnityEngine;
using Assets.Scripts;
namespace Assets.Scripts.Editor
{
[CustomPropertyDrawer(typeof(global::ShowOnlyAttribute))]
public class ShowOnlyDrawer : PropertyDrawer
{ .... }
}
using Assets.Scripts; is greying out and its failing to find ShowOnlyAttribute inside of ShowOnlyDrawer.cs
Im getting the "type or namespace could not be found" error for `ShowOnlyAttribute" inside ShowOnlyDrawer
I have 2 rigidbodies: player and vehicle. When player is in vehicle seat i make him a child object of vehicle so that it "sticks" to the vehicle. But then I want to disable player physics and gravity. If I set isKinematic = true then it seems player blocks movement of the vehicle. I see disabling Rigidbody is deprecated.
How would I implement this? Do I need to remove & reattach Rigidbody each time?
Oh ffs I missed the global:: on that type, derp derp, have to remove that and it works
Can you post the inspector of the character
what code do you have?
public class EmotionsController : MonoBehaviour
{
private float mSize = 0.0f;
private void Start()
{
InvokeRepeating("Scale", 0.0f, 0.01f);
}
private void Scale()
{
if (mSize >= 100.0f)
{
Debug.Log("Done Running");
CancelInvoke("Scale");
}
GetComponent<SkinnedMeshRenderer>().SetBlendShapeWeight(0, mSize++);
Debug.Log("Running");
}
}
Used this from someone's old tutorial on youtube to see if it would work, but at the moment it doesn't
that looks ok for setting toungeOut, should work
When I run the game it changes the weight for a split second but more in a 'glitchy' way, not how it should
you may be better using a coroutine rather than invoke repeating
That is what I used before trying this
I have tried the most ways to change a value through script, and none of them could change the value
But GetBlendShapeWeight does work correctly, so it reads the weights properly, and gets the correct blendshape counts
But SetBlendShapeWeight does not work
having gravity field for every surface doesnt sounds great
I use SetBlendShapeWeight in a coroutine and it works just fine, maybe there is something else affecting things
That is weird, let me check
maybe make a new project with just this model and script in it, see what happens
and I would definitely use a coroutine for this
This project is just that, I wanted to see if it works so there's nothing else atm
Its how most folks do it, you can lookup videos on how stuff like Mario Galaxy was made and thats pretty much exactly what they did (except in 3d so they have even more types of fields)
I would too, but the first attempt didn't work, but imma check if I missed something
Can you tell me what it differs NativeArray to an Array with simple examples and how memory handles that?
Array is native to c#
iirc NativeArray is a unity thing
internet says NativeArray offers more control over memory and usually goes in par with JOBS
@knotty sun
public class EmotionsController : MonoBehaviour
{
private SkinnedMeshRenderer EmotionsRenderer;
private float mSize = 0.0f;
private float mSizeUpgrade = 10.0f;
private void Awake()
{
EmotionsRenderer = GetComponent<SkinnedMeshRenderer>();
}
private void Start()
{
StartCoroutine("TongueEmote");
}
private IEnumerator TongueEmote()
{
for (int i = 0; i < 3; i++)
{
Debug.Log("Forloop check");
EmotionsRenderer.SetBlendShapeWeight(0, mSize);
mSize += mSizeUpgrade;
yield return new WaitForSeconds(1f);
}
yield return null;
}
}
Made this real quick and still is not working, the coroutine works as the debug.log prints three times
Array lives in managed memory while natives array live in cpp kernel
NativeArray is basically a C# wrapper around a C++ array. It's there so you can use it in the Job system which is all done on the native memory side.
Hm so its used for manage its lifetime by manually. Thank you
the slider does not change in the inspector?
Nope it doesn't
have you tried it with the other BlendShapes?
Of this character, yes
None work, and the sliders are 'stuck' when game is running
hmm, no idea, theres nothing wrong with the code or setup. maybe ask on the Blender discord
Will do, thanks anyways
Trying to figure out a solution here to an issue for my UI code, might need some insight.
Tile based game, the player can select a given tile to move to it. With mouse they click on it, but I also have built in KB / Controller support, which lets them move around the "selected" tile before they can submit and then it acts like they have clicked said tile.
All this logic works the same way, the mouse click vs submit with KB/Controller should do the same thing.
I draw a highlighted path of Tiles from Player -> Target, to show the route the player is going to go as well.
All of this works fine, except for one hiccup: I have logic so that if they move the mouse anywhere that isnt a valid tile, I erase all highlights and set GameState.UI.SelectedTile back to null.
Problem is, every frame Im doing these checks and thus if they have these conditions:
- Mouse is hovering over an invalid square
- They press WASD to move their selection
It first moves their selection over (using player as the starting point), but then it goes "Oh wait, your mouse is over an invalid square, actually erase all those tiles now"
I need to figure out a way to remember if it was KB vs Mouse that was the last input, and its looking like I may just need to straight up save this to a variable :/
However, perhaps I can first check if the mouse has moved or clicked since last frame, and only use its position then?
Nevermind, thanks for rubber ducking yall haha, it was actually straightforward after I reasoned that out above:
private Vector3 _lastMouse = Vector3.zero;
private Vector2Int? GetSelectedTile()
{
var currentMouse = Input.mousePosition;
if (currentMouse == _lastMouse)
{
return GameState.UI.SelectedTile;
}
_lastMouse = currentMouse;
var mouseRaw = Camera.ScreenToWorldPoint
(
Input.mousePosition,
Camera.MonoOrStereoscopicEye.Mono
);
// and then I do the thing
...
}
Hey! i have this variable in my code: public UnityEvent questGoalReached = new UnityEvent();. I would like this event to get invoked when a specific boolean changes to true. is it possible to set this up using the Inspector?
like so?
public void CheckIfComplete()
{
quest.goal.IsReached(); // this line will return true/false
}
Whats the contents of IsReached()?
public bool IsReached()
{
return (currentAmount >= requiredAmount);
}
You will want to fire off the event when currentAmount and/or requiredAmount change
Specifically something like
CheckIfReached() {
if (IsReached) {
QuestGoalReached?.Invoke();
}
}
Or however it is unity events work, I dont use em, I use normal C# delegate events personally as then I can utilize in T for structs to make the event as lightweight and smol as possible
no probs, I declare this delegate on its own, to start, which lets me create events of in T
/// <summary>
/// Custom Delegate for Property Change Events, utilizing "in structs" for minimum memory usage and maximum performance
/// </summary>
public delegate void ReadonlyEventHandler<T>(in T propertyName);
And you can set up the event on your class via:
private event ReadonlyEventHandler<SomeVarType> MyEventName;
And then you invoke that event via the usual:
MyEventName?.Invoke(myVarOfThatType);
in my case SomeVarType is a string, so I would pass a string into the invoke, but you can make it whatever you want
and then you subscribe to it via:
ClassReference.MyEventName += (in SomeVarType e) => {
...
};
Or
ClassReference.MyEventName += OnMyEvent;
public void OnMyEvent(in SomeVarType e)
{ ... }
Both work
thank you
(in what part do you define what "myVarOfThatType" must be in order for the event to trigger?) thx
events can only be invoked from the object that owns them. so in this case myVarOfThatType would either be a local variable or field on the object that owns the event
its just some variable or whatever, its a value you pass in
So if you declared your event as type of ReadonlyEventHandler<string>, then myVarOfThatType would have to be a string.
But like...
MyEventName?.Invoke("Hello World");
would be valid
I hate this btw, its so annoying that you cant make the event invocation like, "protected" or something.
It forces you to have to make a protected wrapper method if you wanna inherit from that class that has the event, that all it does is invoke the event, smh
You can use a delegate without the event keyword and invoke it from anywhere
protected void InvokeMyEvent(string value) => MyEvent?.Invoke(value);
So annoying that I have to do this so often if I want inheritance to work, lol
can you still subscribe to that? Also that doesnt work with interfaces then does it?
Generally events protect you from making bad APIs
Also then that means non-inheritted members can invoke the "event", which we dont want. We only want that class and its children to invoke it
purely just want to be able to invoke events on subclasses without being forced to make a wrapper method
This is only annoying if you plan to make a bad API
No? Its pretty normal to want your subclass to be able to invoke an event it inheritted from the parent
It's a consequence of how event works, yeah.
Mildly annoying.
I've run into that before.
I hope they eventually fix that to have like a { invoke } decleration or something
Id imagine it as like
public event MyDelegateType MyEvent { private/protected Invoke; }
Would be nice
GameObject.Find is static.
Should I make the Singleplayer object static?
No.
Do what the error message tells you to: qualify it with the name of the type (GameObject), rather than a specific instance of the type (the gameObject variable)
it's very unclear what you are trying to do in that line of code
also your IDE is not configured !code
(is the bot still dead? Ofc it is...)
it's on its union-mandated smoke break
that line of code is crazy/nonsense for several reasons:
- your GameObject.Find issue
- the fact that you are passing a parameter into GetComponent
- the fact that the parameter you are passing into GetComponent is a nonexistent variable
- the fact that you are assigning the result of GetComponent to an
intvariable
basically in its current form that line is just nonsense.
I mentally papered over all of those problems, somehow
proably because the IDE isn't configured and isn't noting any of them!
I imagine the goal was to get the "target kills" field from that KillTracker
yes
I imagine that whole thing is unnecessary, and that you would/should do all that in OnTriggerEnter
also, updated version
and that you would/should do allthat in OnTriggerEnter
you still have many issues on that line:
#archived-code-general message
But the first issue you need to solve is that Visual Studio is not set up properly
π Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/
π Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.
I'm trying to access targetKills and kills (from the Player gameobject)
well, trying to do this isn't going to work:
KillTracker tracker = /* something that gets it */;
tracker(TargetKills);
that's what you tried to do
So what's the solution?
thanks
you've accessed fields several times in that screenshot above
e.g.
PlayerTransform.position
I'm still very new to Unity and C# so pardon my ignorance
this retrieves position from PlayerTransform
If you're brand-new then you should ask future questions in #π»βcode-beginner
While we're still here, how do I get KillTracker from Player specifically?
configure your !IDE π
and () to invoke a method
damn is the bot still dying
also you cannot use GetComponent in a field initializer, do that in Start or Awake instead
Hi all, is anyone familar with how to tag nodes in the A* Pathfinding project?
trying to apply a penalty to non-paved sections of the map
Random quick question. Using unity Camera.main.WorldToScreenPoint to place reticles on the screen in relation to large coordinates. Is there a reason why if you choose a large coordinate (I did 0, -2000, 0) it makes the UI element disappear? It's probably a simple reasoning but I'm confused.
if the world coordinate is not in view of the camera, it will be offscreen.
why are you manually choosing coordinates?
for testing purposes
it won't actually be manually selected, but the actual coordinates would be a lot larger
the short reasoning is because I want the illusion the world is bigger than it really is, so if an object were to theoretically be thousands of km away I want a dot to represent that
it doesn't matter where it is
if it's in view of the camera, it will be on screen
if it's not, it won't
if the coordinate is in view of the camera you mean?
yes
gotcha. Would there be a potential workaround for something like this then?
Not sure how games like Eve: Online do things like this
It's very unclear to me exactly what you're trying to workaround
if an object is not visible in the camera, why would you want to draw a thing over it?
Okay...
So in Eve: Online as an example. There can be objects multiple Astronomical Units away from the user. They can represent those as dots / reticles of some kind as UI elements in the "direction" of the element.
yes that's not what I'm talking about
it's a question of the camera is literally not looking at it
you said earlier you did (I did 0, -2000, 0) as a testing scenario
I find it unliekly your camera was in a position to see that position
yes and I'm looking in the direction of that coordinate
then it will work
but it does not
maybe show your scene layout and the code
and what WorldToScreenPoint returned
sure one sec
do note that the position returned from WorldToScreenPoint includes a z coordinate which is the world space distance to the camera
if you just plugged that directly into your UI element's position, it might literally be too far away to see
according to the camera's far clipping plane
you can/should just zero out the z coordinate
yes okay let me try that. I saw things regarding that on the web but wasn't sure if it was applicable
that was entirely the issue lol
Thanks so much, sorry if I was unclear initially. Hard to convey my problems lol
nah you did a pretty decent job it just wasn't clear to me that your camera was definitely looking in that direction already and it was clearl just disappearing after a certain distance
Yeah it was obvious to me but I didn't consider directly outlying that was part of the problem. Thanks again!
alright, I'm fairly lost here
I'm working with tilemaps, and I often forget which tilemap is currently active, which leads to all kinds of problems during level design
this is a code channel
scripting could work around that, that's why I'm posting here
what? do you want a script that makes you read what tilemap you are currently editing?
juka.Eyes.LookAt(tilePallette);
I mean, if I change the palette, it changes the tilemap also
so I don't have to manually change it every time I change the palette
or maybe there's an easier way around this
or maybe scripting is the way, and I should write a class that does that through the editor
I am clueless unfortunately
I found a thread with a similar problem, this one: https://forum.unity.com/threads/2d-tilemap-change-the-active-tilemap-by-script.577012/
but I honestly can't figure out what's going on
maybe I'm missing something
Hey, I have a very basic Mesh that represents a grid. For this example, every square is made up of four vertices, and the square are all connected to each other via two triangles.
The UVs for a Square are: (0,0), (1,0), (0,1) and (1,1). I'm wondering what the best approach for controlling how materials render on these connecting faces are. Right now they just appear as duplicates of the texture on the main face, which isn't ideal.
Change the UVs. Give the actual grid squares a section (perhaps [0, 0] - [0.5, 0.5]) and give the connecting faces a different section of the texture: ([0.5, 0.5] - [0.5, 1.0]) for example
Ah so for example two cells in a line, I'd split the X 3 ways to account for the connector in the middle
How would that actually turn out in implementation though? I'm struggling to visualize all this UV stuff.
I'm guessing if I wanted to connecting face to have a different texture I would either need to modify the existing texture to 'fit' in, or create duplicate vertices and a new submesh
how do you want it to look?
I already submesh for every cell that needs a different material. I'm just not a huge fan of duplicate vertices.
I'm going for a 'fit everything' solution (This is purely a learning project for me and I like to make them 'framework/library'-y). I don't think I'm very bothered by the texture having to be designed with the grid in mind though
whats the purpose of the connectors?
I'm pretty sure using shaders would make a lot of things a lot simpler but I am deathly terrified of them
I reckon I'm going to have to rewrite this mesh generation stuff a couple time irregardless, I was feeling very confident about it and then made the mistake of going online and looking at other solutions.
other potential solutions i had in mind also were shader based
as for uvs, they extend indefinitely
so you can go 1.25 for example
for the connector
and scale it with height
It's really tricky to wrap my head around because the connecting face doesn't have any extra vertices and I can only have as many UVs as vertices.
So if we take the picture above, the cell to the left will add:
(0,0) (1,0) (0,1) and (1,1) to the UVs. What else would it be expected to add if I wanted to treat this face as apart of the texture (so any material on it will kind of wrap around, it won't look good- but it'll make sense.)
in any case, this is deeply tied with shaders
if you avoid developing a shader that helps you achieve this task you will be stuck with 2000s problem solving
you can do the above without shaders, you can just use a single massive atlas where each "tile type" texture is tiled several times
so tiles uvs are offset into the center of the tiled group
if the height is limited
I'll make sure not to use any outdated Unixtime formats. My apprehension to use shaders is just a temporary restriction, I do plan to get around to it at some point, it's just a little off topic for what I'm trying to learn right now.
So, with two cells next to each other my UV array looks like this:
[(0,0) (1,0) (0,1), (1,1), (0,0) (1,0) (0,1), (1,1)]
1.25 references to (0,0) ? Or in other words, 'One extra to the right'
My UVs can be larger but I'm assuming the .25 is just 1 / Count of UVs
i dont understand the "references to 0,0" part
uvs are not limited to 0-1
shader will simply loop the texture after 1
well that depends on the shader right?
oh i think i understand
if its an atlas yes this is just a template layout
you mult it by tiles, offset inside the atlas etc
and 0.25 becomes scaled by height
so if you have height limited to say 3 units, you can pack 7*7 tiles in one tile group
you can also use a 3d texture btw to split the tiles so you dont have to use atlas, and can use uvs as is
but that requires a shader that will sample the texture from array based on something
like vertex color
I am listening, but I feel like it's a bit past what I'm looking to do. Right now, I'm really not looking to exit the boundaries of just 'Setting Vertices, Setting Triangles, Setting UVs', but I do pledge to make the people who made all this wonderful technology possible proud and actually use it afterwards.
Right now the top crudely drawn picture is what I have, and the bottom one is what I want.
yes the picture i posted solves this
the uvs will be continuous
wait a sec, in your case even if the top connector started at 0
it should be continuous
you possibly have winding order issue?
I think I might, because if you notice the orientation of those materials isn't quite how I would like it either.
Actually I think I drew that right- which is wrong :P
uvs might be mapped to wrong verts
I'm a little confused on what maps them at all. This is where I'm getting caught with all of this actually, and I'm sure it's you not me- but it is a bit tricky to warp my head around.
It's mainly the 'You can only have as many UVs as Vertices'
And I don't have any extra vertices. There is four in a cell, and then, for this example- two to its right
But those two are used in the proceeding cell. I'm not sure what UV is telling anything to appear on these connecting faces.
then you can only use the approach i suggested
since you cant break the strip
1.25 and so on, go over 1, below 0
Help me here though,
So, two cells next to each other:
[(0,0) (1,0) (0,1), (1,1), (0,0) (1,0) (0,1), (1,1)]
Are you saying rather than repeat, the second (0,0) should become (1.25,1)
Or
[(0,0) (1,0) (0,1), (1,1), (1.25, 1)... etc... (0,0) (1,0) (0,1), (1,1)]
Which exceeds the amount of UVs I can have
if its one big continous mesh that is not broken but is a strip, then first
Just to be clear, I do want each cell to have it's own UV space. There is only about the connecting faces sharing that cell's material.
For example, I don't want this:
you cant create a uv space if its one island
you can overlay islands on top of each other, so each one will start at 0,0 but it has to be a separate island
Is what you're saying, if I want the behavior I'm describing- I'm going to need an extra row of vertices inbetween each cell?
you technically can its just going to look broken because interpolation will fail to flatten it over uv space properly
I might be misunderstanding you completely but would adding these extra vertices make all of this a lot easier?
had to fire up blender
this is what happens with uvs when its continous mesh and youre setting the uvs to 0 on verts of a strip
that face which ends up at 0,0 from whatever uvs it was to, will be warped
problem is not in adding more vertices its in having the vertices being shared by faces
you can hack around it by having a face of 0 length in there that hides the transition, but at that point why not break it
Some Jargon here is throwing me for a loop. Apologies if it is frustrating. What exactly does breaking it mean in this context?
What I know right now is that, when I don't 'try' at all, and simply set the UVs for the front face, the other four duplicate, and so on. As far as I'm aware (1,1),(0,0) is the same as (1,1)(1.25,1.25) because the UV loops.
That's what is in my head right now, other than the glimpses into what I want in Ms Paint.
sorry was away, if you have 2 faces but 6 verts its one continuous strip
2 faces share 2 verts
if its 2 faces and 8 verts, its 2 separate faces, they dont share verts
so there is a "break" or hard edge in the mesh
where 2 verts coexist in one spot but are not connected to each other
I see, this does seem like the best way to do it if I want to stick with what I have. It is a shame adding an extra vertices per cell but I suppose it isn't too bad
it introduces its own set of problems
It does. For example, if I ever wanted to add any sort of offset to the edges of a cell- suddenly I need to move two sets of vertices
why are you manually encrypting something
The C# docs have code examples for AES encryption:
https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.aes?view=net-7.0
because I have no idea what you mean by "the final block"
when I build the rig builder on player for second time after host with netcode for gameobject i get this error
MissingReferenceException: The object of type 'UnityEngine.Animations.Rigging.RigBuilder' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
so i hit host then i hit disconnect and then host agian and in my code build the rigbuilder after setting both arms target from code
leftArmIk.data.target = gun.leftHand;
rightArmIk.data.target = gun.rightHand;
rigBuilder.Build();
The final block encrypts the last plain bytes of data, adding padding if it's not long enough to fit a single block's length
But yes, you don't call these manually
right my link includes examples for full string encryption
It's the old way yeah. You might also see some examples where they use a byte[] buffer to encrypt blocks of data to keep the RAM usage low. You don't need it with streams anymore, these are buffered internally.
The docs example have the right way of doing it
How do I display the current player coordinates while the "S" key is held down?
Display it in what way?
for debugging, or in the game?
For in the game
The player needs to be able to view their coordinates, but not always on
just make a ui text element and do myText.text = myPlayer.position.ToString();
that's the basic gist of it
alr ty
BRO I just set the background colour to black and
Tanked from 500
anyways to another channel!
I have a game with characters defined by being an object with a bunch of fields, only the values differing on each character. Is it good practice to read those in using external data storage rather than baking them into the game (e.g. reading JSON files instead of declaring them at runtime)?
I.e. Something similar to RimWorld, which uses Reflection to link up code references on load after reading in all value fields
Sounds like a use case for scriptable objects, where you can define all the different values into an asset and just plug that into a character. Though im not entirely sure what you mean declaring it at runtime, are you calculating these values based on something?
No, they're purely arbitrary (e.g. "maxHealth" or "backstory")
Lemme take a look at those π
What you were thinking with json is pretty much what you'd do with a scriptable object
I take it they work similarly, just with proper integration with the editor?
Saying they work similarly is a major stretch, but in this use case yes
Functionally they reach the same goal?
Json is just a file format, while a SO can run code. Its use case though is just to be a data container
That sounds convenient, can they have their fields changed at runtime?
Or would the game need to be recompiled to edit one
Yes but you should more so treat it as immutable, because these dont exactly save their values in an expected way. In a build the values dont save, while in the editor they seem to
Ahhh I see
The values persist between scenes only if the SO is used in the scene I believe
I see-- if I need to retain the ability to permanently modify fields, would it be wiser to use JSON or is there another design pattern I can use?
You would need to write to some file for this, regardless of the format you choose (formats being like json). I just wouldnt write to a file everytime the value changes
For something like max health or just general player stats, that value should just be read from your file at the beginning, persist through your game in some script, and write to the file every so often like end of level, maybe at checkpoints, when the user presses save
Makes sense- thank you!
There has to be a better way of doing this. It's a way to let players place building components
I'd like to know this too ^
it depends how the player is supposed to choose
I use an array of scriptableobjects for this kind of thing generally
or an array of prefabs
no need to specifically call each out in code
Using a Building script as your reference instead of GameObject will also make your life much easier
Well they currently just press num keys 1-5 to indicate hotbar position
then you just pick whatever prefab or SO is at that position in the array
I also need to store a calculation to work out the way it's facing based on rotation (pipe pieces) so if they rotate a straight segment, the neighbours are now north and south rather than east to west
Ideally it would be an object
sounds like just data that should be on your SO or on a script on the prefab
I think the main issue is that I have no clue how to point to a prefab/gameobject without it being added via public props panel
that's exactly what I'm suggesting
public Building[] buildingPrefabs; // add them in the inspector```
Does it have to be added via inspector?
that's the simplest way
there are of course other ways but that's for later
huh?
what is an object {}?
what do you mean other properties?
The properties would be on the Building script
So I can easily do:
{
"prefab": GameObjectHere
"neighbours": 5
"health": 100
}
public class Building : MonoBehaviour {
public string BuildingName;
public Sprite MenuIcon;
public PipeDirection PipeDir;
public int Health = 5;
// etc..
}```
This can go in the same file?
Then when you do cs public Building[] BuildingPrefabs; you can just read that data directly
same file as what
The other building code
sure
ty I'll give it a go
I'm a little confused if I've done this right as nothing comes up in the inspector
you can't have multiple MonoBehaviours in one script file
yes you have an empty list of them
you need to make a separate file for Building
and then you need to attach the Building script to all of your Building prefabs
and set the values on them all in their own inspectors
ah that was why I was wondering, I saw the mono and wasn't sure
ohh
Put the Building thing on the prefab
yes
ty
Slightly off topic question that I'll ask while it's on my mind. How would I "shift" this enum? For example, north, east, south, west but then I want to rotate the object 90 degrees. Is there a mathematical way to do with without a ton of maths?
public enum BuildingNeighbours : byte
{
None = 0,
North = 1,
East = 2,
South = 4,
West = 8,
}
I guess something similar to bitshift
Maybe bitshift right 1 then add 4?
is there a good reason you're doing it as a bitfield?
Oh wait nvm
i see
it can have multiple neighbors
Yeah
you can shift it then just if (x > West) x = North;
ty
if the object itself rotates, doesnt the neighbours still stay the same?
Not in this case because I need to know it's neighbours relative to the global gridspace for calculations
public static BuildingNeighbours Rotate(this BuildingNeighbours directions, int rotation)
{
int value = (byte)directions;
for (int i = 1; i <= rotation; i++)
{
if ((value & (int)BuildingNeighbours.West) != 0)
{
value <<= 1;
value |= (int)BuildingNeighbours.North;
}
else
value <<= 1;
}
const BuildingNeighbours all = BuildingNeighbours.North | BuildingNeighbours.East | BuildingNeighbours.South | BuildingNeighbours.West;
return (BuildingNeighbours)value & all;
}```
This is what I do. Hopefully it works for you
Your enum is missing the [Flags] attribute
ahhh I see, thank you.
The enum still doesn't let me tick "everything"
maybe if I add an "everything"
nope
you need to add [System.Flags] to this enum if you want multi select
is it possible to cache a list of FieldInfo and make it not be cleaned by unity when entering play mode?
Rig builder doesn't work after destroying once
Does anyone have any advice for where to start to setup a server in C#?
related to multiplayer, or?
I'm not trying to do multiplayer yet, I just want to learn how to set something like that up and start writing code for it
For my current game, I'm going to make a server for the leaderboard, so less complicated then multiplayer
you dont need an entire server for a leaderboard, just some online database or maybe theres a tool built already for this
Yeah, that's true
a quick google search shows theres a good amount of tutorials exactly for this
I'll look into doing it that way
just a warning though, leaderboards like this are gonna be extremely easy to manipulate. if you want this to be for a competitive game, you'll have to have a lot more than just a simple leaderboard
otherwise you'll quickly get spam entries of people submitting fake times/scores
By hacking my game? Is that easy to do? I'm just making a mobile game
I don't think anybody would want to go to the trouble to do that though
you underestimate how easy stuff like this is for some people, it almost wouldnt even be a trouble. Some people just like to fuck stuff up for fun
lol
but if its a mobile game, i doubt its really gonna be competitive so i wouldnt worry about it
you could just occassionally clean the leaderboard from clearly fake entries
Fake entries would not be distinguishable based on the way my game is, as a perfect score is pretty easy to get
I'll just keep copies of it incase someone does something to it
I have an enum for InputModes (for what happens when you click), and I want to cycle between them
Is this stupid? It works, but it feels stupid:
if (Input.GetKeyDown(KeyCode.T))
{
_inputMode = (InputMode) (((int)_inputMode + 1) % (Enum.GetValues(typeof(InputMode)).Cast<int>().Max() + 1));
}
enums are pretty much integers
Yep. Which is why I was casting to int
Should I just use an int instead?
I thought that you don't even need to cast it
Oh, I did get an error when I didn't
General question about the c# garbage collection, if I have an object listening onto changes from another via events I would assume I need to unsubscribe for this object to be cleaned up, right?
I just wrote for some random enum in my project to add by 1, it didn't get errors?
Although you'd have to deal with looping back, modulo will do: i % length.
Idk how to get the count of enums though, lemme check
My error was from the modulo
One sec, I'll copy it over
CS0019: Operator % cannot be applied to operands of type InputMode and int
yes u do have to cast it
Huh... Alright, my bad.
I have a player that can swap what he's holding, the animations of items have Events, indicating times like StartSwing, EndSwing, Shoot etc, but since the item isn't always there, I can't directly "tell" the items.
I suppose that I needed to make a script on the player, that could pass the events down to the current held item.
I see multiple options available to me here, but I can't decide on which to use, or if there's a better way to do this.
-
Make a generalized EventBus system, meaning that it could be used elsewhere if ever necessary. However, this would certainly be less performant and costs more memory too. As different events are added across animations the amount of Events in the event bus would increase no matter if the event is used by the current held item or not.
-
Make a EventBus system that is specifically meant for this, that the event busses aren't registered in a list, but are independent variables instead. No more looping through a list (Nor creating dictionaries)
-
A minimalistic way, it's likely the most performant and cheap in memory: Create a script that simply passes an integer to the held item. However you wouldn't really know what the signal stands for without checking the animation.
-
Slightly better then 3, just pass a string instead. At least then you know directly what the signal stands for. But you'd still need to check how exactly it's written. And comparing strings are less efficient.
So... Is there a way that is "meant for this purpose"? Or at least something that can keep the readability without adding too much unnecessary costs?
Have an IItem interface that contains OnPlayerEvent(PlayerEvent) where PlayerEvent is an enum. Then if you need to fire the event, just do someItem?.OnPlayerEvent(PlayerEvent.Shoot)
delegates store 2 things, the method to invoke, and the object to invoke it on. Which is why that happens
Huh... Yeah, lol didn't think about usings enums
Yea I guess I'll use that then, thank you.
Yeah, makes sense, just had to make sure before I spent all the time cleaning it up :)
What could be a cause of mesh renderers randomly turning off when instantiated? I'm not doing it through code anywhere
is the mesh renderer component being disabled, object being set inactive, or its just invisible?
the mesh renderer component is being disabled
when I enable it, everything works well, I don't know why it turns off now
first check the prefab to see if its even enabled on there, otherwise id just create a copy of the scenario and try removing features until you can locate what specifically is causing it
if you really dont know where the problem originates from that is
it's enabled there. I have 2 prefabs, one nested in another. When I spawn one of them, all is ok, when I spawn another, it gets disabled.
Weird part, is that there's only 1 additional script in the second one, that has NOTHING to do with the renderer. It is short, and it doesn't even reference it
oh wait it has a recttransform for some reason
That wasn't the issue :(
Remove the component and see if an error is thrown - whoever's accessing it will not be happy.
Else you'll have to show code if you're accessing it but convinced it's not something you're doing.
unless theres a null check, but yea i just assume theres something secretly referencing it. or some error causing it to disable π€
sadly, no error :(
this helped
turns out a base class was at fault
forgot it wasn't just a pure monobehaviour
ah glad you narrowed it down
@hard viper just a heads up I made a small tweak to that PropertyWatcherBase code I shared with you prior, might be worth it to snag the latest version if you used it already.
Hi I'm trying to do this coroutine but it keeps telling me errors. If I try to remove one thing, other things get affected. Help!
why did you pass in the type with the parameter
you dont need to
just StartCoroutine(FadeCo(_scene))
<----- complete newb and is basically trying to ramshackle code together
then ask in #π»βcode-beginner next time
if you need a refresher on scripting, there's the beginner scripting course pinned in #π»βcode-beginner
either way, that should be the problem. you're just passing in parameters wrongly
okay, soryr about that
I thought this was a more bigger issue than I thought. Thank you
I have been using Rider for one and a half years only using free trials and do not plan to ever pay for it.
Can anyone here explain to me how I can apply a floating origin system to a multiplayer game?
i have a 3d array i would like to edit in the inspector, any ways to do that?
i know you can create custom editor things but im not very experienced with that
You can create a struct that hold three int variables, and when you run the game, take those values and instantiate the array.
ooh good idea
ill see if i can get that working
yep that worked out! i think structs were better for my use anyway
thanks sm!
Hey guys, I wrote some code to run around and jump using a rigidbody. But for some reason if you press the move forward key and the jump key at the same time "sometimes"(i guess depending on timing) you jump super far and the velocity of the character goes nuts. whats causing this?
if (isGrounded == true)
{
var inp = gameInput.PlayerMap.Walk.ReadValue<Vector2>();
var moveDirection = new Vector3(inp.x, 0, inp.y);
moveDirection = moveDirection.normalized;
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;
rb.velocity = moveDirection;
//Jump
if (Input.GetKey(KeyCode.Space) && isGrounded)
{
rb.AddForce(transform.up * jumpForce, ForceMode.VelocityChange);
}
}
you are overwriting the velocity constantly to be moveDirection so most of the time your jump would be doing nothing from the looks of this. Your jump force is probably insanely high if you go flying like that
and isGrounded would be false at that point so you are no longer overwriting the velocity
Hmm this probably explains why my jump is inconsistent sometimes you dont jump as high as other. My jump force is o nly 1.5
any tips on how i Can fix this issue? I tried using AddForce for the movement, but every frame makes the character move faster every frame
you can add force and then manually limit the velocity to some max
you'd also want this in fixed update
normally i will use impulse for jumping
impulse is just a velocity change that divides by mass
would I still calculate moveDirection the same way with add force?
that didn't change anything
you can if you want the player to get up to speed pretty quickly. regardless you'll still need the max speed to limit it
addforce will gradually increase character speed to a threshold
velocity manipulation will force the character to move with that speed instantly
ok funny enough
im not sure why this happened
but simple structuring the code this way fixed my issue
//Jump
if (Input.GetKey(KeyCode.Space) && isGrounded)
{
rb.AddForce(transform.up * jumpForce, ForceMode.VelocityChange);
}
else
{
var moveDirection = new Vector3(inp.x, 0, inp.y);
moveDirection = moveDirection.normalized;
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;
rb.velocity = moveDirection;
}
Is there some way to auto generate GUID's when I add an object to a list in my scriptable object? Also is there some way to guarantee I never change them? Or do I just have to manually generate them and try to never touch them again
Havent really used guid's before but basically im just storing a bunch of hats to spawn for the player in an SO, and I want to store which one they chose to wear in a file + send the ID over the network. I dont want to store index of the list incase i end up changing the order later
Guid.NewGuid() is a random one iirc
Sorry to dump in the middle of a discussion. Does anyone know of any resources related to large-scale terrain systems in Unity, or even in general?
I already know that many games achieve large scale environments pretty well. Ones that come to mind are MSFS 2020, DayZ/Arma, Rust, Stalker, etc. I already know 2D games can manage long or large maps pretty easily (especially side-scrollers) by keeping the player at the origin and moving the map around.
Is doing this in 3D a similar concept? I have an idea of how to do this by keeping the player at 0,0, though I can see potential performance issues in calculating/translating relative distances between players and updating tons of objects.
I did find this, and someone suggested storing global offsets of chunks and I guess relocating the player. I can probably engineer a solution myself, but wanted to know if there's knowledge on how to do this or any pitfalls before I begin.
https://forum.unity.com/threads/the-way-unitys-precision-works.1287797/
getting a Guid isnt the problem, I was just wondering if I could generate one when I add to a list in my SO. Id probably need some editor code for this now that I think about it
Like you just want a consistent Guid per hat forever?
I used some mathf and found best solution
transform.up = -target + (Vector2)transform.position;```
You can use Guid.Parse and straight up store em in a constants file tbh, that's what I do, I use an online guid generator and just generate a whole bunch and just have a bunch of constants in a cs file
The way I handle this is I wrote a class that generates an ID 0 - X and generates a class that holds the ids to variables so it doesn't matter if the ids change
Can also store em in an actual sql dB if you want performance for lookups
Hi,
I would like to create a plane and set its size using a bounding box, how can I do that ?
I tried modifying meshrenderer.bounds, but it's not accessible for set, only get
yea pretty much, id store them in a file but I need some way to reference them to a hat then. If the order of the hats change then the guids arent consistent, which is why i wanted them in the SO
ill probably just use an online generator then
performance isnt an issue, i got like 10 hats atm
if you want to change the size of something, use its local or lossyscale
actually i think lossy doesnt let you write either so it might just have to be local only
Chunks, I believe, is how people do it
You want chunks anyways to help out with culling to reduce draw calls
I see. I found another person that mentioned storing position in a matrix. i.e: every 100,100, you can store a reference to the chunk it's in, and relocate the player + environment back to 0,0.
Is there anything I could look into for more information on chunk programming? I get the concept in my head and have an idea of how to program it, but I can totally see massive bugs by moving tons of game objects at once.
Also, more about mesh optimization, I know someone that managed to do dynamic subdivison (or un-subdivision) using Quad Trees. https://www.youtube.com/watch?v=Dy-Zn5XUZ_w
rust maps are 8km x 8km you dont need to worry about offsetting anything just position the entire map so center is 0,0,0
you can make maps up to 19999 x 19999 km this way
Well I do know at least in VRChat, some worlds can have the problem incredibly fast. Hop in a plane, fly for 1 minute, and your entire game is jittering around.
20kmx20km is pretty good and I can probably have that for now, but I wanted to see the feasibility of going larger than that, and if it's something worth doing now just so I have the functionality, or if I should just try to patch it in later if needed. Especially since the game I want to develop would have some air vehicles
There are some tricks that games like grand theft auto use with aircrafts to make the map feel larger
there is a whole video about it somewhere on youtube
Yeah, they make them fly horrendously slow π
My idea based on what that reddit post said, I guess it to have the chunk position as 2 Ints, and then a relative positon as floats I guess, or I guess I wouldn't need that since I have player position already.
your'e g oing to run into issues with the ram the map consumes before floating point
have you figured out how you're going to stream the level in and out based on position?
Not specifically, but I know that I would need to stream the assets
basically
I haven't worked super deeply with Unity to understand how the main thread handles this, but my hope was to offload as many things as I can to other threads using DOTS
you can do it all with dots using subscenes
yeah
So this? Unless this doc is outdated.
https://docs.unity3d.com/Packages/com.unity.entities@0.50/manual/loading_scenes.html
β
Get the Project files and Utilities at https://unitycodemonkey.com/video.php?v=91kJtsDLTyE
Let's check out Subscenes in Unity, what they are and how we can use them to make Massive Worlds!
Subscenes use Unity DOTS / ECS in order to be insanely performant with nearly instant loading.
When closed they represent their contents as Entities and whe...
whoa! sick! Thank you
Ah yeah, crap, I remember seeing this demo a couple years ago. Can't believe I forgot it π
but you could store eveyr object in each scene inside of an empty gameobject
that you just position based on position if you need to worry about floating point
I see
I think I will consider the options and come up with a solution. I can see potential issues with physics or other things with moving the player every X amount of chunks. Though maybe if I do this every 1km or 2km it'd be less of a problem (for the re-positioning).
The other problem I can see is the terrain itself. I have zero experience with the workflow for creating a seamless terrain (I was hoping to make it in blender). I also really do not enjoy working in the unity editor to place objects and manage some of that stuff.
But I guess I can decouple the terrain from the subscenes, and the terrains can be larger with dynamic LOD.
the problem im forseeing is how do you know when you reposition the player/world the player wont be inside of a building
hmm, good point
Well, I mean. The idea is to have a chunk, and the position of the player in the chunk is relative. So when you "reposition", you re-position both the player and the scene around them. But I am not sure how to handle that with player networking/projectiles across chunks, etc, and obviously that is prone to latency issues with updating all those game objects.
with networking you'd just send what chunk they're in and the offset
tbh
you could probably make really nice system that takes care of level streaming, network culling and floating point error all at once with this
Oh yeah for sure!
good luck
thanks
Honestly, my main goal is not even to finish the game. It's more to explore the possibilities and learn skills along the way.
I mean, it would be totally great to have a more open, moddable FPS platform akin to DayZ, Stalker, etc., which really is my goal. But I anticipate that I won't finish it at all, and if I do probably not for years.
Like I think: "We have the technology to do multi-threading with ease and huge processors with tons of capability, plus tons of optimization techniques. Why don't we have a game like this yet?"
Like I look at Tarkov quite often and I am like: How do they manage to make their game run so poorly? π
So I want to push myself into those architectual challenges to really determine "is it really that hard?"
Also John Carmack has given me a lot of (maybe unrealistic) expectations and inspiration for pushing optimization to the limit to achieve incredible experiences. I look at Doom (especially the modern ones) and think "wow"
ended up just using a ContextMenu, which I forgot existed, so i could generate them in the SO based on the existing list of hats
iβve compiled a project that works with mono with il2cpp and it crashes after the made with unity bit
iβm on macos and unity 2022.3.4f1
log says SIGTRAP
please ping me if you have a solution ^_^
i don't really know the solution in your case, but if it works with mono but not il2cpp it's usually code stripping in my experience
hm?
here's an info dump, if that's even the problem you're having https://docs.unity3d.com/Manual/ManagedCodeStripping.html
somebody please correct me if i'm mistaken, but i think code stripping can cause a build to successfully build while still causing crashes when playing
i may be mistaken there, haven't run into this recently enough to remember
its on minimal
and i dont think stripping would affect it since the error is SIGTRAP
pretty sure its breakpoints in a debugger
stuff like that
no clue why it gets triggered though
Doesn't it say more in the Player.log? Can you post the whole thing?
hey guys I am doing Photon PUN2 multiplayer game, first player creates a room then joins a game, second joins room and then the game, my problem is when the second player joins, his avatar spawns twice(when you are first player then you spawn correctly only once)
this is my code
the script is attached on a gameobject that is already on the map, so it instantiates the player, when he loads the scene
Better asked in #archived-networking, they know more of that kind of problems.
oh ok
Anyone know of a fix for this?
Unity.Entities.Analyzer references netstandard, Version=2.1.0.0, Culture=neutral, A roslyn analyzer should reference netstandard version 2.0
Started happening when I migrated to a new pc.
lemme get it
ok yeah makes sense
how come it doesnt out of memory with mono though?
public void Execute()
{
float targetSpeed = _isSprinting ? sprintSpeed : moveSpeed;
bool isMoving = _playerDirection != Vector2.zero;
if (!isMoving)
targetSpeed = 0f;
float inputMagnitude = _playerDirection.magnitude;
SetSpeed(targetSpeed, inputMagnitude);
_animationBlend = Mathf.Lerp(_animationBlend, targetSpeed, Time.deltaTime * speedChangeRate);
if (_animationBlend < 0.01f)
_animationBlend = 0f;
if (isMoving)
RotateToInputDirection();
var targetDirection = Quaternion.Euler(0f, _targetRotation, 0f) * Vector3.forward;
a.Begin();
_characterController.Move(targetDirection.normalized * (_currentSpeed * Time.deltaTime) +
new Vector3(0f, _controller.VerticalVelocity, 0f) * Time.deltaTime);
a.End();
_animator.SetFloat(MovementController.SPEED, _animationBlend);
_animator.SetFloat(MovementController.MOTION_SPEED, inputMagnitude);
}```
this generates me 80B of garbage and i dont understand why
```cpp
_characterController.Move(targetDirection.normalized * (_currentSpeed * Time.deltaTime) +
new Vector3(0f, _controller.VerticalVelocity, 0f) * Time.deltaTime);```
thats with deep profiling?
why does the thing allocate THAT much memory
it doesnt seem right
it works on mono but not il2cpp???
this is so weird
toggle deep profiling in profiler
there you go
but why
because unity, marshalling, editor
but if i pass just a Vector3.up, it doesnt allocate garbage
pass where?
in characterController.Move
do you have any collision receivers that receive collision data?
yep
ControllerColliderHit is?
this is the only part im interacting with the collisions of the character controller
i mean is it a class/struct?
a class but its built in unity
thats what allocates most likely
Unsure to be honest, perhaps "/Users/emm312/Desktop/coding/C-C++/openVCB-Full/build/openVCB.app/steam_appid.txt" does exist for the Mono build. I guess the /coding/C-C++/ part is different in Mono.
But it's clearly running out of memory.
yea i guess
maybe also some GetComponent from collision.collider
thanks a lot :DD
hm no m_Collider cached
yeah
thats like
in the millions of gigabytes?
https://www.reddit.com/r/Unity3D/comments/15ezkmh/unity_is_crashing_whenever_i_open_it/
This has the same amount of RAM allocations as you, he just restarted his computer and it was fixed.
No idea if it does in your case, but he has the same 18446744056630378496B allocation as you
@versed loom ~60 b
public class ControllerColliderHit
{
internal object m_Controller; // 8
internal object m_Collider; // 8
internal Vector3 m_Point; // 12
internal Vector3 m_Normal; // 12
internal Vector3 m_MoveDirection; // 12
internal float m_MoveLength; // 4
internal int m_Push; // 4
}
80 may come from padding or RTTI
they use object? kinda weird
its still broken after a restart
update all packages