#archived-code-advanced

1 messages Ā· Page 156 of 1

hushed fable
#

Replace the path with one of those methods and add the _Data part

lofty inlet
hushed fable
#

Not sure honestly, but odds are any of them is good enough. I would look into the documentation of each of those APIs to see what they actually represent

lofty inlet
#

so I would need to download something for it to work? or does this work with the base Unity?

#

it's also saying I need to include System.Reflection which I've never heard before

hushed fable
#

All of these are included afaik

undone parrot
#

I'm interested as to why 'Transform' only implements the base IEnumerable and not IEnumerable<T>. Would be lovely if we could use LINQ on it without casting

stuck onyx
#

why do you think i over complicated the effect?
I was using DoTween myCanvasGroup.DoFade(0, 1.0f) and I also had this difference of duration problem thats when I decided to do my own and I dont know why but now is solved. Thats what I wanted to know the why.
Yes, camera.Render is sycronous by default. Since i cant fade out without the render having finished it's ok for it to be synchronous, am I wrong?.

coarse grotto
#

Can anyone guide me from where I can learn code for "Unity's Augmented Reality"?

remote oar
#

anyone here has any experience with quaternions and can explain my why this code makes my gameobject rotate on the X axis too? It should only rotate on the Z Axis:

        Vector3 dir = Input.mousePosition - pos;
        float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
        Quaternion newRotation = Quaternion.AngleAxis(angle, Vector3.forward);
        targetPanel.transform.rotation = newRotation;
#

its hardlocked at 90f on the X Axis

plucky laurel
#

i assume the object is world aligned?

austere roost
#

Hi, I have an architecture design based question. Not sure if it's the correct place to ask. I have a few scriptable objects (questRequirements, questRewards & questGoals), which are all referenced in a QuestSO (to basically make a Quest). Now, modifying directly the SOs is not something I would like to do however, this hierarchy needs to be "cloned" during runtime to an object which I can modify on the fly without problems (essentially track and mark the progress of that particular quest). Any bright ideas on the best way to achieve such a system?

hushed fable
#

You can create new instances of SOs in code

normal cedar
#

well it could be done if you were to make savefiles. then you could change the SOs and then save the changes

austere roost
#

Maybe i didn't explain my problem correctly. I'm finding it hard to explain haha bare with me. Say a quest has 3 goals, kill x amount of enemies, visit a location and talk to npc 2... these need to be tracked...but I cannot set the variables in the scriptable object during runtime, so those variables need to be "cloned" somewhere (like a gameobject) at runtime, where i can modify them as the progress of the quest goes along.

sly grove
#

or at least, all of its serializable fields

austere roost
#

hmmm...and that will not modify directly the asset but an in memory copy?

sly grove
#

If you modify the result of that, correct, it's an in-memory copy

austere roost
#

along with all of it's referenced "sub-SOs" ?

sly grove
#

No, it will not be a deep copy

#

If there are references to other SOs on it, it will copy those references exactly

austere roost
#

yeah then i need to clone the whole "hierarchy" :/ or at the very least, the questGoals[] SO references :/

hushed fable
#

Maybe a deep copy method in Quest that actually does the traversal would be the way to do it

austere roost
#

and of course i don't assume there is such a thing...it has to be coded manually aye ? šŸ˜›

hushed fable
#

Not that I'm aware

austere roost
#

ehhhhh fair enough... thanks so much for the help

paper stump
#

Hi,
i develop a multiplayer game. the player movement is server authoritive with client-side-prediction and server reconciliation.
So i turned auto-simulate off and (sometimes) recalculate physics several times in a single frame on client side.

Is there a way, that only the physics for the own player-movement is recalculated, and other things like weapon projectiles or other objects with rigidbodies are not recalculated?
It would be weird if this physics for weapons shots are also recalculated on client side.

I heard somethind about physics-scenes, is this a way?

tough tulip
flint wind
#

@austere roost I'm doing that with a non-SO class for an active quest in progress. It has references to the SOs that define its parameters, and variables for each objective to track the progress.

austere roost
#

you know, like based on the RequirementType, show a field for an item, or a location instead of showing all the fields... mehhhh so confusing lol

flint wind
#

I didn't have a good event system for handling objective tracking, so I should revisit my quest objects now. That code is probably hideous and naive

paper stump
tough tulip
indigo nexus
#

what is the error and what i do

#

so any help?

thin mesa
#

make sure you have the Input System package installed. Looks like that asset requires it

#

(also not an advanced question)

indigo nexus
thin mesa
#

i just gave you the answer my guy

indigo nexus
#

i didnt understand any thing

indigo nexus
thin mesa
#

you don't need to ask your question anywhere else, you just need to install the Input System package.

indigo nexus
hexed ledge
#

what is the best way to have an enemy move on a slop?

#

currently for the player i am doing raycasts to check if its on a slope. I can do this with enemies but that seems like alot of overhead for a simple thing to see if they are on a slope

regal olive
inland cairn
#

Hey, how can I create concave collider?

inland cairn
#

Okay, but when I add rigidbody to go it wont work.

#

It wont collide with other colliders

magic vigil
#

@inland cairn you'll have to approximate it with multiple convex colliders as children

inland cairn
#

Ok I'll try it thanks

random dust
#

Hi, is there some way in dependency injection to find out what lifetime a specific type has? I need to figure out if a type is a singleton service, but I have no idea where to access the ServiceDescriptor list to check that. Is there some class that I can inject alongside my services that give me this information?

torpid dove
#

Can anyone here help me to deal with long code? I'm advanced in c# but when it comes to read long code that other wrote things get complicated.

tough tulip
sly grove
random dust
#

Sorry, you're right. Should've specified I am doing this with the build in one

covert aurora
#

If you need to have fixedupdate and update in your script, which one comes first?

fresh salmon
covert aurora
#

Kk thanks

stuck onyx
tough tulip
covert aurora
#

Okay that helped tho thanks

pseudo dune
#

sorry if this is the wrong place to post.

Is there anyway to not let the character leave the platform or max amount of distance possible ?

Current code is changing the direction of the character if no platform is detected, while changing the gravity. However, at higher moving speed, the character will be a distance away from the platform and slowly fall back .

proud fiber
#

i could potentially get paid thousands to make a crane training sim in vr, could it be possible to make an external controller with say an arduino and use it to controll things in unity?

humble leaf
proud fiber
#

sweet thankjs

near garden
#
public class Example : MonoBehaviour
{
    void Update()
    {
        foreach(Animal exampleAnimal in animalList)
        {
            if(exampleAnimal.isAbleToRun)
            {
                Run(exampleAnimal)
            }
        }        
    }    
    void FixedUpdate()
    {
            
    }
    
    void Run(Animal.exampleAnimal)
    {
        exampleAnimal.animalRigidbody2D.velocity = movementDirection*exampleAnimal.speed;    
    }
}

Hi there. I know that i should use FixedUpdate for rigidbody related things. For this code example, how can i do the logic in update and change velocity in FixedUpdate ? Thanks for any help.

#

or should i ?*

fresh salmon
#

In this specific case, no need, as you only set the velocity directly

#

If you used AddForce though, you would need FixedUpdate

#

In that specific case, putting the whole loop inside of FixedUpdate would have solved it

near garden
#

What if i don't add force constantly , the same? I wrote a function to calculate initial velocity for addForce.

#

In the original code there are a lot of calculations

fresh salmon
#

Separating the code is needed of you need to poll input using the Input class, as Input is tied to the framerate

regal glade
#

Is there any way to disable the built in batching of the sprite renderer? I have dynamic and static batching disabled but it still batches objects using the same texture that are on the same order in layer.

near garden
near garden
fresh salmon
#

But, you need FixedUpdate if:
- You're using AddForce with a ForceMode other than Impulse or VelocityChange
- You're using deltaTime anywhere in the calculations, to "smooth out" the forces over a few frames. That specific case also requires you to use Time.fixedDeltaTime instead.

near garden
#

Oh, probably i will only use impulse.

#

Thank you so much @fresh salmon . Then, i will continue using Update.

violet schooner
#

does anyone know what's the code behind transform.Translate?

austere jewel
violet schooner
#

thankx

regal olive
#

Why do people say that behavior trees are easy to implement?

#

I've been doing my own implementation and it doesn't seem like there is great information on how to write up a behavior tree yourself.

#

The "gameaipro.com" books are full of super neat ideas but a bit sparse on important implementation details

#

So... Am I an idiot and me struggling with my own behavior tree implementation is a signal of how I just don't grok the subject? Like is there someone out there who can write up a behavior tree implementation with their eyes closed?

gentle topaz
#

what parts in particular are you struggling with?

#

the actual implementation?

regal olive
#

Nah, I'm not struggling any more. I finally came up with something that works great

gentle topaz
#

Both of those resources you linked are actually really good at explaining it

regal olive
#

It just took a while and I had to tell myself "stop looking for the answer because it doesn't seem to exist publicly"

gentle topaz
#

the video is a good concept primer and the implementation is good to skim over for some gritty details

regal olive
#

The bummer thing about the Packt resource is that it's full of bugs...

gentle topaz
#

yeah, I don't know if it was really tested or not

#

Seems like a concept example

regal olive
#

Maybe that's the problem? Too many people are showing 'concept' examples and not really discussing a real implementation

gentle topaz
#

Sort of a like: "Okay so you want to evaluate at each node and recursively return the state"

#

And less of a: "I will basically copy this into my game"

regal olive
#

I guess in that way, it served it's purpose. Although the second I read through the code I was like 'wait, that won't work as advertised'

#

I got my implementation going now and it's really good, but wow is there a lot of misinformation out there.

#

Wait, have you implemented a BT @gentle topaz? Can I see your implementation?

gentle topaz
#

No, I have not

#

I get the concept though

regal olive
#

Interesting

#

Not a call out, I genuinely think its interesting

#

I feel like it's a partial answer to the original question

gentle topaz
#

Yeah, there are always implementation roadblocks when trying something brand new

regal olive
#

Good luck if you get to implementing one. Maybe you will find a good source that can guide your implementation and it will turn out to be simpler than what my lived experience was šŸ™‚

gentle topaz
#

The part that seems a bit vague to me is actually building the tree

#

But I suppose you might just do that entirely manually

regal olive
#

Right now I'm building mine in code. At some point, I will create some editor scripts

gentle topaz
#

Although you can probably use some of Unity's workflow tools (scriptableobjects, etc) to make that process less painful

gentle topaz
regal olive
#

Yea my plan was to (eventually) think about what the implementation could look like if it used SOs and if I could justify that setup.

gentle topaz
#

At a surface level, seems like it would work quite well

#

that is not always how things go though, so I would have to try it myself first

#

Binding the delegate actions would be the difficult part there

#

Would take some extra labor to get it all set up properly

regal olive
#

you get it

#

Yup. And my question is "how can I justify the complexity of a SO implementation?"

gentle topaz
#

It depends on how much extra work the action binding is, or if you need the AI design to be user friendly (for example if you have other people on a team working on it).

#

Typically I would prefer scriptableobject to hard coding a bunch of immutable data

regal olive
#

How many BTs will I ultimately have in my game versus how much time/effort it would be to create a designer user interface for the BTs

gentle topaz
#

yeah, the number of BTs is also a large factor

regal olive
#

Typically I would prefer scriptableobject to hard coding a bunch of immutable data
Interesting... Can you elaborate on this point? I'm curious what your thought process is.

#

(since this is the internet, I'll also say that I'm asking not to attack you but because I like hearing other people's opinions and experiences)

gentle topaz
#

Just... If I am setting up anything like base stats, pathfinding heuristics, world generation parameters, etc, I like to have it be easily accessible—and with no recompile involved when editing (which ScriptableObjects are just great for)

#

I think it also helps me mentally encapsulate the data structures more efficiently

#

It's just my personal preference

#

Obviously I can't do that outside of Unity though, haha

#

So maybe I overuse it

#

But yeah, basically any set of data that won't change at runtime is something I typically look to ScriptableObjects for when implementing

regal olive
#

Thanks! I appreciate the insight

gentle topaz
#

But like you said, that ratio of time spent implementing to amount of SOs used is also important in making this choice

regal olive
#

Obviously I can't do that outside of Unity though, haha
To this point... I really, really like treating monobehaviours and scriptable objects as "humble objects" as much as I can and instead try to encapsulate logic in vanilla C# classes. I do it for many reasons, but one of them is practicing pushing the framework/library used as far away from the core domain logic as I can.

gentle topaz
#

I do use ScriptableObjects quite a bit because of that last point I made there but

#

I definitely agree that encapsulating logic in vanilla C# classes is a great way to go

#

I am currently working on my own engine using a framework and I have been quite glad that I already encapsulated most of my logic and used minimal Monobehaviours while I was learning how to program using Unity (which was pretty much the start of my programming career)

regal olive
#

Yea. Even if the code isn't portable (Unreal is C++, which != C#), the practice is the thing that helps push away the framework details.

gentle topaz
#

Just makes you a more versatile programmer

regal olive
#

Agree

#

I started when I asked myself "well, how the heck do I test my Wordpress extensions?" turns out... Humble object pattern.

regal glade
#

How is the SpriteRenderer able to manipulate the sharedMaterial mainTexture without altering all other objects with the same material, and without instantiating them?

regal olive
#

More context: Wordpress testing is a bit rough because of the architecture of wordpress was built before automated testing swept became popular.

regal olive
#

I could do a better job of elaborating on the Wordpress stuff but I'll leave it there.

gentle topaz
#

Yeah, not familiar with Wordpress... I am fairly inexperienced in general—I haven't built many non-game applications or done really any web dev

#

Trying to work on improving that versatility though (however, games remain my main interest)

regal glade
#

@tough tulip thank you i think that might have done it

regal olive
#

The wordpress stuff is some things I do as a freelancer

#

@gentle topaz what is your story? Are you a student learning unity for a future career working for a AAA or indie studio? Someone looking to switch careers to find a dream gig?

gentle topaz
# regal olive <@!241752541015048193> what is your story? Are you a student learning unity for ...

I am a student (although I am taking a break from college at the moment) and I hope to work in the indie scene. I haven't had any sort of dev jobs because I am 19 and been mainly doing college full-time. Not exactly sure what I am going to do, but I have some freedom for now.. Trying to quickly get as good at development as possible without any real plan (at this point I pretty much do dev at least 11 hours per day)

#

Whatever I do, making my own stuff will be my hobby, and I intend on continuing on the path of self-improvement

regal olive
#

Ha, that's cool that you're a into this stuff and improving your craft at your age. I'm late 20s/early 30s and put my dreams on hold to chase that cheddar (no complaints).

Not sure if this is something you might want or need, but can I talk to you about the legal stuff around games? Just to maybe have a bit of an influence... If you know how to create and maintain an LLC and you know a bit about legal stuff, maybe you could unite your local talent and make something cool. Kinda like how if you know how to be a Game Master/Dungeon Master, you can get a D&D game off the ground.

For your consideration... Here are some GDC talks about legal stuff. If you have some time, I would encourage you to watch and maybe take notes. If you can be the person who knows about this stuff, you can essentially be the glue for talent.

Practical Law for Indie Devs 101: https://youtu.be/8eAW-7Js7NA
Practical Law for Indie Devs 201: https://youtu.be/t8UFJ3obm-Q
Practical Law for Indie Devs 301: https://youtu.be/ePQcAjuiSEo

gentle topaz
#

Wow, thanks so much! I will check all these out. I actually have a few friends who have various talents that synchronize well with game development and also love making games—and we frequently work together. I know nothing about actually creating a studio or getting a project off the ground, so this is great.

#

Actually, I should watch more talks in general. I'll start with these and move outwards to get a better idea of how to "professionalize" this whole thing.

regal olive
#

Yea totally. It's actually pretty easy and relatively cheap to start an LLC in your state (presuming you are from USA), although I don't want to bury the lede and not mention that there are requirements for maintaining an LLC over time.

My advice if you do create an LLC is to also create new accounts in Unity,your version control (GitHub), email, and everything else. Only do LLC stuff on those accounts. The neat thing is you could then possibly sell your LLC to someone else if you want to cash out.

gentle topaz
#

This is typically where job experience is nice... But I might as well get a head start, and I also really want to be a startup if at all possible (I at least want to try it out)

regal olive
#

Even if you are looking to be an employee, it registers real nice with the interviewers if you know about the business/legal side of game dev.

#

I say -- don't wait, explore making an LLC. In my state, it cost me $50 to become the CEO (lol) of my own game studio LLC.

#

Even if you don't do anything with it.

gentle topaz
regal olive
#

Like I said, this is just for your consideration. If it isn't your jam, no biggie!

gentle topaz
#

Thanks again for all these pointers, seriously. I have been kind of ignoring that aspect of game development because it seemed a bit out of reach

#

Knowledge is power, I guess

#

Setting up a company would probably boost some motivation to continue projects as well

#

I think I should probably log off though, although I will at least watch the first talk (right now I mean). Currently 7:20 AM and I have been programming for like 10 hours lol

regal olive
#

An all nighter, heck yea.

#

Same. I enjoyed this convo. At me if you have questions about BTs, when/if you get there!

charred monolith
#

Hello Everyone! Does anyone know about saving Scriptable Objects in a List to a json file?

tough tulip
charred monolith
#

And this is when using Json.net for Unity?

tough tulip
#

yes

charred monolith
#

hmm I am still having an issue of it reading the scritable object

#

It just prints it as an instanceID

sly grove
#

Did you do what malloc said with the attributes?

#

Show the code for the SO

old viper
#

I have an interface field in my class. When doing hot reload (changing code), that field becomes null.
How can I run a code when that happens to populate that field again when that happens?

tough tulip
#

after an assembly reload, the previous interface you had saved doesn't exist at all

lone elk
#

Greetings gentlemen, perhaps anyone happens to know an asset or a general approach to 2D aiming with ranged weapons?
(perhaps that's a bit more maths/physics question, but I'd consider it advanced enough to be post here)
On attached gif there's my custom implementation, which does not take force of the throw into consideration, therefore the misses you can see with spells. (red line is tangent to quadratic function)
https://gfycat.com/silkyfarawaygecko

sly grove
#

Taking into account the force is easy, you are only interested in the initial velocity

normal cedar
#

@gentle topaz you said you were working on your own frame work? Do you mean some development tool for games aswell?

molten haven
#

Hello,

I'm trying to use unity's netcode for gameobjects,

I'm trying to call a ServerRpc but it doesn't get executed and returns in the console this warning:
[Netcode] Deferred messages were received for NetworkObject #0, but it did not spawn within 1 second.

Has anyone ever faced something like this?

On the internet I could find basically nothing,
If the warning is accurate, in the emails domain, it means that the server is blocking incoming data?

But clients can connect just fine, it's the ServerRpc that is not working...

#

I shoul add that I am testing all of this in localhost

old viper
# tough tulip its not possible. when the hot reload takes place, theres an internal logic whic...

I don't think that's true, not entirely anyway.
The interface is a component (actually), it's just exposed as an interface.
I also have another field that's of type component, and that one is working correctly.
Both are assigned at awake only and not dragged and dropped as properties.

That 2nd field isn't null after the hot reload.
So if it's just references - both the interface and that component are references.
If it's just objects that are dragged and dropped in scripts - both don't meet that.

lone elk
tough tulip
old viper
#

@tough tulip any suggestions to make it work with the interface then? or is the only solution to make the type non-interface?

ancient talon
#

is there a place in Unity where I could have an assembly reference alias set? I am having an issue with a plugin being conflicted with two or more assembly reference. I found something online as a workaround solution, but it seems to work within Visual Studio project solution and not unity's project solution.

I guess my question would be this:
A) Is it possible to infer which assembly reference I want to use inside someone's else plugin, and if that's not possible, B) Where can I go and add reference alias inside unity?

#

I've tried using directive reference, but no luck!

#

This also pisses me off that even with implict library reference, it still can't resolve the issue.

candid thunder
#

Is anyone here knowledgable in Ninja-build?

#

I'm trying to get it to identify a ninja installation

#

But no matter where I put it, it always comes up as ACCESS IS DENIED

#

Even though I've ran it as an administrator.

regal olive
#

Check the permissions of that file

candid thunder
#

The build file?

#

or...

regal olive
#

Both the file in your downloads folder and the permission of the ā€œninjaā€ binary

candid thunder
#

i dont understand

regal olive
# candid thunder i dont understand

The error message you are seeing appears to be a permission issue. Finding out what your user is unable to access will be key in resolving your issue.

Either there is a file permission ā€œissueā€ on the binary (ninja) or there is one for the file in your downloads folder.

That said I don’t, I don’t have knowledge of ninja build so if someone else wants to interject

candid thunder
#

I am the administrator on the system though...

#

I'm SUPPOSED to have all access to everything.

#

but then again I deal with windows

old viper
#

@candid thunder permission denied error in windows is sometimes a generic one.
For example sometimes when files can't be accessed (e.g. bad drive or network drive not accessible, or just locked) you'll get that error.
Sometimes it does mean access (because you can change specific access for specific files), but not always.

candid thunder
#

What are the ways I can fix it?

normal cedar
#

Is there any reason c# would not be able to create a directory/file on a linux server?

#

for some reason it does detect the folder and says it exists but when i look on my ftp, i can not find anything

old viper
normal cedar
#

my code

cinder bluff
#

Anyone used OVROverlay? I've got it working, but it has different behavior on Quest vs PCVR. On the former, it's always on top. On the latter, it's in the proper depth but you can make it the other way by turning off Shared Depth Buffer in PC XR settings or checking No Depth Buffer Testing on the OVROverlay script. I'm wondering if there's something the Quest just doesn't support to make it work with the proper depth. There's no similar setting I can find like Shared Depth Buffer for Quest/Android. As far as I could tell, it seems GL_OES_depth_texture extension is what's needed to support that, and when the app runs it seems to report GL_OES_depth_texture as being on. Trying to figure out if there's some way to get it to work like it does on PCVR but coming up with nothing.

warm adder
#

Hya. How would I register changes to an Enum in a object (serialized). Use: I got a public array made out of a serialized class. The class is containing a bunch of different variables, among them the Enum. I need to know when the enum changes. I tried using events / delagates, but monobehaviour doesnt seem to work in a serialized class?

normal cedar
#

thats correct. you are gonna have to have a monobehaviour class that checks for it.

you could ofcourse make a reference to your serialized class

warm adder
#

How would that work out, a reference to the serialized class?

#

as in, how would I listen to that reference?

normal cedar
#

yeah just call your class in the monobehaviour class

#

ill type it up

warm adder
#

I am changing the variables with references to the classes; they are stored in an array, and when I want to change something I call that array. But, for convenience sake it would be nice if I can then Listen to those changes inside the serialized class or inside another ref.

#

Ahh yeah if you could type out an example that would be awesome

normal cedar
#
public class RandomClass : MonoBehaviour
{
    public class PlayerClientObject PlayerClient;

    public void OnEnable()
    {
        PlayerClient.S_ThrowBall.OnBallStageChangedEvent += BallStageChanged
    }

    public void OnDisable()
    {
        PlayerClient.S_ThrowBall.OnBallStageChangedEvent -= BallStageChanged
    }
}
#

Something like this

#

@warm adder

warm adder
#

Ahhh. So I regsiter the events Outside of the serialized class

normal cedar
#

exactly

warm adder
#

And BallStateChange would then also not be a method inside the serialized class?

#

no it Is probably a method in the serialized class

normal cedar
#

youd have to mess around with that i am terrible at eventsa

warm adder
#

Thanks. Messing around atm šŸ™‚

candid thunder
#

I just want to compile something

#

But I need ninja to do it

#

but ninja needs ninja build

#

and its there

#

and has the permissions

#

but it says access is denied

warm adder
#

Hmm, PlayerClient.S_ThrowBall doesnt seem to work

#

I cant get the class after I reference the object

#

I think I'll just use properties, that seems to work better

gentle topaz
ancient pilot
#

hi, so I have a idea, but i dont really know how to implement it into unity.. so.. I made a character controller, but I want to switch to a different (solid, non-moving) camera

#

and then I want to switch back to the character camera so he/she/it can proceed with finishing the level

humble leaf
ancient pilot
#

yes?

#

okie thanks

#

I've downloaded c inemachine..

regal olive
#

Could someone help me make it so I can make it so instead of clicking the arrow to choose an avatar they could just click a continent that will then be assigned to that player?

regal olive
regal olive
#

I don’t believe so no, that seems like the most efficient way to me

regal olive
#

I have no idea how to do it, and I'm thinking that I have an idea of how I could do it a different way

#

Okay that’s fine I understand, but maybe you want to look up about clicking on UI elements in the future

#

Like I could have multiple public voids for each continent and basically making it so when one of those continents are clicked then it will be assigned to that player

#

Okay that sounds like a good approach!

#

Good luck šŸ™‚

#

Thanks

hot dock
#

I have a big issue. I have found out that I have to put my code for ScriptableObject inside an assembly, but I already created some instances using the old one, serialized.

#

I didnt think that adding the Assembly would break the SO that I already created... is there a way to fix this? Some sort of [PreviouslyAssembliedAs("Assembly-CSharp")] or something like that?

sage radish
hot dock
#

oh, so there is one?

#

This [MovedFrom] is a "Unity thing", or a "C# thing"?

sage radish
#

Unity thing

#

Only used by the Unity serializer

hot dock
#

Can you maybe point me to some docs?

sage radish
#

Similar to [FormerlySerializedAs]

#

There doesn't appear to be a documentation page for it

hot dock
#

:(((

#

My intellisense also does not seem to autocomplete that attribute

small badge
#

Yeah, it's undocumented. I believe it's in the UnityEngine.Scripting.APIUpdating namespace?

sage radish
#

@hot dock But it's used like this:

[MovedFrom(false, null, "NewAssemblyName", null)]
public class MessageNode
{
}

You can see the attribute definition and some basic documentation here:
https://github.com/Unity-Technologies/UnityCsReference/blob/91bea9bc5698d7b18524f5e5016c980e4cece639/Runtime/Export/Scripting/APIUpdating/UpdatedFromAttribute.cs#L46

GitHub

Unity C# reference source code. Contribute to Unity-Technologies/UnityCsReference development by creating an account on GitHub.

#

Confusingly, it's in a file called UpdatedFromAttribute.cs, but the attribute is called MovedFromAttribute

hot dock
#

I have seen this example right now, googling. I wonder what every attribute represents...

#

oh, i see... maybe that will be enough

sage radish
#

But I've also done Find & Replace on scene and prefab asset files in the past

#

I think I had some issues with this attribute not working fully.

hot dock
#

So i guess I could try this...
[MovedFrom(true, "Conversa.Runtime.Nodes", "Assembly-CSharp", "MessageNode")]

sage radish
#

You can pass in null for the things that haven't changed

hot dock
#

oh, nice to know!

#

This might be enough then
[MovedFrom(true, null, "Assembly-CSharp", null)]

#

@sage radish I will try it! Thanks a lot for your help!

#

I was scared for a second, that my existing object were going to be ruined

#

šŸ’¦

violet schooner
#
transform.position = (float3)transform.position + (input * Speed * DeltaTime);

I don't know what I'm missin to make this code account for the rotation of the transform.
I'm basically recreating transform.Translate inside of a Job.

orchid marsh
#

Also, the above may get more attention in #šŸ’»ā”ƒcode-beginner as this channel is less populated and often reserved for more complex questions.

sage radish
violet schooner
#

thanks

regal olive
#

How would I change this code (https://hatebin.com/olstbqtnsy) to make it so it goes straight to a certain element instead of it switching through the elements?

cosmic basalt
#

@regal olive what do you mean switching through the elements?

regal olive
#

like before if I clicked an arrow it would go to the next Avatar but I want it so I can click one of the continents then it will shows that continent as my avatar

calm field
#

Hi, i have a big problem. When my Asset Folder gets larger than 70GB the editor becomes extremely slow

shadow seal
#

Jesus Christ

#

I am not surprised at all

calm field
#

it runs fine, until i get to a certain threshold. It's unuseable now, It takes more than 30 min to open a project

shadow seal
#

I'm surprised it does

#

It is 70GB

calm field
shadow seal
#

So it isn't code related at all then

calm field
#

probably not. At least not my code^^

shadow seal
#

I'm not sure you're getting the point mate

calm field
#

ok, if u insist i will post in another channel

#

thanks anyways

shadow seal
#

I mean, I could have left you to the hounds

cosmic basalt
#

and that way you would also avoid that class growing with more and more onclicks

shadow seal
#

All those methods look identical?

molten haven
#

Hello,

I'm trying to use unity's netcode for gameobjects,

I'm trying to call a ServerRpc but it doesn't get executed and returns in the console this warning:
[Netcode] Deferred messages were received for NetworkObject #0, but it did not spawn within 1 second.

Has anyone ever faced something like this?

On the internet I could find basically nothing,
If the warning is accurate, in the emails domain, it means that the server is blocking incoming data?

But clients can connect just fine, it's the ServerRpc that is not working...
I shoul add that I am testing all of this in localhost

hushed fable
molten haven
# hushed fable I think it's essentially saying that the NetworkObject the message is directed f...

I think I was able to debug it correctly, tell me if there is something that looks strange to you:

I'm working with only UI elements, so everything is on a canvas,
If I give a panel the networkObject script, I can parent networkObjects to it, EVEN if there is no networkObject on the canvas.
However it looks like if a panel is deactivated during the loading of a scene, then any child networkObject are not correctly spawned.

#

I was receiving that error when that NetworkObject was spawned on the server but not on the client because the client was on a build and the server in the editor

#

And the one on the build connected "wrongly" (?) because of deactivated NetworkObjects.

#

Is it really impossible to have a scene with networkObjects that start deactivated (or activated but their parent networkObject is deactivated)?

tepid mulch
#

Hey, just checking, does anyone know if (and if so, when) the default behavior for an undefined Layer in a Layermask changed from 1 to 0? I have been investigating an issue for over a day and eventually concluded that even though the LayerMask dropdown look identical, the serialized int between two versions of our project actually was completely different.

#

(Because all the undefined layers where flipped from 1 (old) to 0 (new).

#

Can't really find any documentation as to this though.

austere jewel
#

I think it's always been 0 afaik

#

You can desync it via various methods though I'm pretty sure.

tepid mulch
#

Yeah, that makes most sense to me, but that doesn't seem to be what I'm observing here

#

Left, new project version, right old version.

#

Meanwhile, the same serialized strings

#
1065352927
00111111 01111111 11111110 11011111 

1048454679
00111110 01111110 00100110 00010111
#

Suspiciously, all the ones that are "flipped" are undefined ones.

austere jewel
#

It may actually be 1. I am almost certain enum flags are 0. But when you add more layers you annoyingly have to modify culling flags in certain scenarios

#

None of the code should have to rely on what values are in those undefined layers though?

thorny onyx
#

Hello. I have an architecture question. I know that there is a simple state machine to handle "animations" but I need a "more sophisticated state machine" to handle all the states of my characters. I mean, a state machine with a lot of features like "transition method" that's return true of false if the state transition has been done or not etc... Should I code my own state machine if I need this behaviour ? It's very strange because if I do my own state machine, my states will have to handle the animation state machine transitions... it's really weird.

tepid mulch
#

So clearly set to some value that used to be defined and now isn't anymore. But if that value was ever defined, it had been removed many years ago. So the immediate question was "wait... how did it render all this time then?"

#

Turns out the old culling mask on the camera had that bit set to 1, even if it was undefined. We recently removed some other value from the camera's culling mask, which must have updated the int representation.

#

Which leads me to assume that somewhere down the line the behaviour must changed or something, or it would still have worked.

austere jewel
#

Ah yeah that'd do it. Sadly nothing is really correct in this scenario

tepid mulch
#

No, it's a degenerate scenario to begin with so it doesn't matter that much, but it sure was awfully puzzling. XD

plucky laurel
#

which version introduced this?

tepid mulch
#

I'm not 100% sure. This an old legacy project, started on 5.x and currently moving to 2020 LTS. It happened after the 2020 upgrade, but it can't guarantee it's because of 2020, because IMO all it took was changing some value on the culling mask to update the bitmask.

#

And I have no record of when/on what version it was last changed. Our git history only reaches to early 2019.

regal olive
#

Question about behavior trees (BTs)… I noticed that many implementations of BTs have two elements: the BT and the behavior (some call it node for some reason). Also, the implementation of the BT I’ve seen as examples traverse the tree and only return a single status for the traversal.

I want to know which behavior the traversal stopped on, so I can resume if a particular behavior returned a RUNNING status.

Now, I know I have two options… I can alter the return type of ā€œbehaviorā€ to return the status and current behavior. I was also rereading the BT section of this chapter (http://www.gameaipro.com/GameAIPro/GameAIPro_Chapter04_Behavior_Selection_Algorithms.pdf), specifically the algorithm, and it dawned on my; maybe ā€œbehaviorā€ and ā€œnodeā€ are two separate entities with two different purposes. Most treat them like synonyms, but maybe they aren’t.

Two questions: what are your thoughts on updating the behavior signature? Has anyone considered a ā€œnodeā€ and a ā€œbehaviorā€ as two separate entities, and if so, how are they different?

#

Updating the signature is the straight forward option, but I feel queasy when I’m updating my non-leaf behaviors signatures (because then they are just passing that data through up to the root node). But maybe that is acceptable

plucky laurel
#

the behavior maybe some "runner" that executes the graph, like a component

#

but its always a graph and a node of that graph

#

and yeah BTs are different from FSM in exactly that any node can execute for indeterminate amount of time, by design

#

i always assumed that "behavior" is the desired result of your graph

#

you are creating it with nodes

#

in a sense you create a behavior with fsm as well

regal olive
#

FWIW I’m just talking about BTs, but I think I get why you are bringing in FSM in comparison.

The way you are talking about the BT seems to support the idea of there being three elements in a BT; a behavior tree, the node(s), and the behavior(s). The BT runner is an uninteresting piece of the architecture, as all it does is call the simple BT interface ā€œTick.ā€

I think ā€œnode is separate to behaviorā€ there is where I am evolving my own thinking into right now, but I think I will want to think about it more to make sure it makes sense.

Your comment helps. ā€œI always assumed that ā€˜behavior’ is the result of your graphā€ suggests, to me, a return signature of the nodes to be ultimately be a behavior.

One more thing: I know that BTs are directed graph but I think the language should be contextually correct. We shouldn’t talk about the math underpinnings of BTs just like we don’t talk about what we want to eat in the language of atoms, if that makes sense.

plucky laurel
#

i have no idea, this is way over my head

regal olive
#

No no, trust me. You are doing great

plucky laurel
#

over my paygrade

#

i see a node graph, i call it node graph, i need agent with certain behavior i use behavior trees to form that behavior with nodes

#

are those nodes a behavior? is the behavior their return signature or the bytecode of CLR i dont know

regal olive
#

Yea and after I submitted the message above I realized… unreal calls behaviors nodes so I guess it is contextually correct

thick thorn
#

ok so.... question about optimization. traditional wisdom says that multiplications take vastly longer than additions. however, if i replace an integer multiplication with an integer addition, i see no speedups. why is this? is it because modern processors are out of order and thus hide such latencies? because multiplication has actually been optimized over the years in hardware? because the compiler is doing something smart that i'm not aware of? is there some other feature hiding the latency? anybody know? thanks.

regal olive
#

I need to remind myself what is my own programmer opinion and what is the more universal stuff. ā€œContextually correctā€ word choice can be used to mask a simple opinion šŸ™‚

plucky laurel
# thick thorn ok so.... question about optimization. traditional wisdom says that multiplicat...
thick thorn
#

i suppose it could be because there's some other operation that takes longer like a cache miss that's hiding the latency of multiplication...

#

thanks

#

optimization is fun but hard, especially once you've gotten the low hanging fruit

fresh salmon
#

Note that for simple operations, the optimizer and JIT reduce them.
At compile time: return 4 * 3
Decompiled: return 12
Same thing if one operand is a const

thick thorn
#

makes sense...

#

in my case though i'm not mutiplying two constants

plucky laurel
#

@thick thorn what are you doing there? porting?

thick thorn
plucky laurel
#

simd in place?

thick thorn
#

not sure what you mean

plucky laurel
thick thorn
#

hmm.... interesting

plucky laurel
#

afaik burst/dots is vectorized

thick thorn
#

makes sense. probably not going to rewrite the whole algorithm but if i could group search nodes together manually and apply simd operations on them i wonder if that could get some speedups

plucky laurel
#

nodes are structs?

thick thorn
#

they are classes

plucky laurel
#

thats a bottleneck

thick thorn
#

is that because the allocator places them in random locations?

plucky laurel
#

you enforce linearity?

thick thorn
#

no

#

i don't know what that means

plucky laurel
#

in memory

thick thorn
#

so like an array of structs?

plucky laurel
#

yeah

thick thorn
#

i'll try that

plucky laurel
#

nah even then, if they are classes you have no guarantee that they will be sequentially placed

#

since memory fragmentation can vary, the allocator can stick them in holes far and wide from each other

#

even if you allocate them all at once

thick thorn
#

makes sense

#

so the issue there would just be cache misses then?

plucky laurel
#

yeah

thick thorn
#

and then i'm assuming all refs to the nodes have to be ref right?

#

so no pass by value?

plucky laurel
#

that depends

#

theres size threshold where ref becomes faster, but it also depends on plain semantics, i.e. where it is necessary

thick thorn
#

interesting.

plucky laurel
#

i benched ref and its always faster or equal to value, but it can be architectural problem

thick thorn
#

i see

#

ok i'll try the array of structs thing and see how much of a speedup i get. is there any different in terms of memory layout between int[,] and int[]?

#

or is it just syntactic sugar?

plucky laurel
#

i dont know

#

i used 2d for years never cared to check the layout

thick thorn
#

fair enough

#

i guess if it's fast enough for you then it's fast

#

thanks for your help

plucky laurel
#

you can also design the whole thing for the jobs/burst system from the get go

thick thorn
#

Yeah…. I might do that in the future but it’s going to be a more drastic step for me

#

Actually I wonder if I can just make the body of the main while loop a job….

#

Damn this is probably a whole field I’m going to have to look into lol

plucky laurel
#

jobs are designed to work with soa approaches, you feed it primitives in arrays, it multithreads them

thick thorn
#

Makes sense.

#

I’ll see how far the array of struct gets me…

plucky laurel
#

even on a single thread i made a struct ecs that performed order of magnitude faster

#

also abused aggressive inline like crazy

#

that was on old .net what was that mammoth fossil?

#

4.8, wait we still use it, HA

thick thorn
#

Hah.

plucky laurel
#

🄲

#

i keep seeing those improvements made in new .nets all those intrisics, jit optimizations, and yeah.

thick thorn
#

Yay Unity

regal glade
#

What am I not setting correctly here? I'm trying to recreate the sprite renderer and making it create a new mesh based on the sprite added, which is working, but the Unity selection outline is broken if you select a multi image sprite and not a single texture.

https://pastebin.com/1dX6p7rS

#

maybe there's some issue with the vertice conversion and they're not in the right order or something

plucky laurel
#

wireframe

regal glade
#

@plucky laurel white box is the girl

plucky laurel
#

there is a way to see the wireframe i know

#

try finding it in the sprite itself, try inspector debug mode, there should be access to the mesh somewhere, then you can view it in preview window

regal glade
#

that should be the wireframe tbh, it only has 2 triangles

plucky laurel
#

typically sprites have optimized meshes to reduce overdraw, so i assumed it doesnt work correctly

#

ĀÆ_(惄)_/ĀÆ

regal glade
#

it is working correctly but something is not working correctly šŸ˜… it's unity's built in preview outline that is bugging out so I have no clue what it is expecting to work right.

formal lichen
#

certainly not advanced, but can you subscribe null to an action?

#
private void SetThing(GameObject mgoThing, Action callbackFunction)
        {
            classMemberGO = mgoThing;
            classMemberAction += callbackFunction;
        }```
#

could I call SetThing(goInst, null) and subscribe nothing?

sly grove
#

Try it and see

#

Why wouldn't you just check for null first though

formal lichen
#

PoC, just copying functionality of some old flash code. Focusing on getting it close enough, then I'll go back through and consider what should be changed šŸ™‚

tough tulip
formal lichen
#

oh good idea!

formal lichen
#

It works without throwing because I call classMemberAction?.Invoke();

midnight violet
#

Anyone got experience with macOS and Arduino, somehow my simple open serial port script just throws an IOException, No such file or directory. It can find the port and I can use the arduino software to access the hardware, so I am guessing its a Unity issue

#

I also tried to start the hub with device=all params

formal lichen
#

Unity works with arduino's?

compact ingot
#

you can make it work

formal lichen
#

is this using Uduino? The most common issue I've seen is the com port being hard coded in and being wrong. Here's a video if you haven't seen yet using MacOS https://www.youtube.com/watch?v=SD3iUnLNjY0

In this video we are going to learn how to send and receive messages between Arduino and Unity with an open sourced plugin. The tutorial works on MAC and PC.
I used Arduino Mega on this video.

Code:
http://www.codetocreate.com/2020/02/06/how-to-integrate-arduino-with-unity-hardware-work-with-software/

Twitter: https://twitter.com/MacyKuang
Ins...

ā–¶ Play video
dreamy marlin
#

Rigidbody question: i am trying to check if an object is touching another object in any direction. i tried the OnTriggerEnter and leave events but those do not trigger if objects are destroyed.. i also tried to sweeptest, but when ever the object is directly on lets say a ground plane, no hit is detected. Any idea how to reliably detect if an object is touching or really close to another one?

regal olive
regal olive
dreamy marlin
#

Would probably do the job

fickle inlet
#

Hey, i just discovered bit manipulation in programming, what can we do with it in Unity, where would that benefit us?

midnight violet
long ivy
plush hare
#

@midnight violetI've had problems getting microcontrollers to talk to my USB ports in the past

#

there's always usually one tiny command you'd be missing that actually enables the port for reading/writing

rapid sky
#

can someone explain me why my bullet only sometimes registers the collission and sometimes it doesn't

#

you can see in the logmessage when it collides

sly grove
rapid sky
#

i'll take a look at that thx

#

Oh lord this is going to be more complicated then i thought

cosmic basalt
sly grove
#

start with turning on continuous collision detection mode on the bullet's Rigidbody

#

your bullet has a Rigidbody, right?

rapid sky
#

Yeyeyye

sly grove
#

and it';s moving via physics, not via the Transform, right?

rapid sky
#

Uhm

#

Good question

#

Wdym with physics and transform

sly grove
#

How is your bullet moving

#

are you using Transform.Translate and/or setting Transform.position?

#

Or are you setting the velocity of your Rigidbody / using AddForce?

rapid sky
#

Let me check

#

ā€˜Transform’ vector 3 shootdirection

#

I think thats transform and not physics

sly grove
#

show the code

rapid sky
#

Oh it’s pretty big code

sly grove
#

that's fine

#

Show the part where you spawn the bullet

rapid sky
#

Look in ā€˜beginner code’ the last archived thread

#

At the top there is the code

sly grove
#

the script you shared doesn't explain how the bullet actually moves

rapid sky
#

whoops 1 sec

sly grove
sly grove
# rapid sky
public class Bullet : MonoBehaviour
{
    private Rigidbody rb;

    void Awake() {
        rb = GetComponent<Rigidbody>();
    }

    public void Setup(Vector3 ShootDirection)
    {
        float BulletmoveSpeed = 100f;
        transform.rotation = Quaternion.LookRotation(ShootDirection);
        rb.velocity = ShootDirection * BulletmoveSpeed;
        Destroy(gameObject, 3f);
    }
}```
#

should do this instead

#

(note you can move rotating the bullet out of the other code now, since you can do it in Setup, but that's just a little extra I threw in)

rapid sky
#

And this script should fix the tunnelling thingy

#

With using the rb

sly grove
#

It will help

#

because now if you go to the RB

#

and set Collision Detection Mode to Continuous

#

you will get less tunneling

rapid sky
#

It was already on continuous

sly grove
#

Ok but now that will actually do something

#

it wouldn't have with the old way

#

also i recommend setting Drag to 0 on your RB

#

So that the velocity will be constant until it hits something.

#

And disable gravity on it

#

unless you want it

#

You were basically not using your RB to actually simulate physics on your bullet before, now it will

rapid sky
#

Thanks!

#

Ill let you know tomorrow how it went imma sleep now

orchid haven
#

Hello fellow humans,
Using the animation rigging package, even if the parent of a constraint's target is moved or rotated, the game objects affected by the constraint do not respond to the changes made by the parent until the Build method is called on the constraint's rig's rigbuilder, furthermore the objects affected by the constraint keep whatever offset the target's parent imparted on the target, untill the Build method is called.
I believe calling the Build method on the rigbuilder is too expensive for frequent use, are there any cheaper alternatives that correct the effects of constraints regarding their target's parents?

dusky lance
#

Hello, I'm struggling with Unitys Rig/Animation concept and I'm not sure if I can bend it to what I am looking for. I basically want to create humanoid looking avatars with just the rig and then add static cube-meshes to the bones via script at runtime. Can I use the existing Avatar things? The rig would provide animations and my meshcubes would be sort of a programmer style lowpoly combined mesh.

dusky lance
#

I'm playing around with it but I cannot find access to the Avatar Structure. Theres no documentation on how these things actually work and what they are. Am I missing something? Is there a way to interact with imported animations (just the animations) from fbx files in Unity?

tough tulip
#

Looks like a beginner problem to me. You need an animation controller for controlling all sorts of Animations and blending in your character. Please browse some YouTube videos and guides on this rather than posting here for your own usefulness

dusky lance
#

yeah I get that, I want to circumvent that. I try to import just the rig and then add meshes to the rig on my own, at runtime

tough tulip
#

you could either use Animator.GetBoneTransform. works mostly with humanoid setup.
for other cases use Transform.Find to find the bone and just proceed with your logics

#

You can also look at unity's Animation Rigging Package if you want to add some runtime custom animation

small badge
#

The Avatar system is mostly unrelated to that; it's an optional system on top of animation that provides more options for a character if its skeleton matches a narrowly-defined humanoid structure.

dusky lance
small badge
#

Beyond that, it should just be the usual process for exporting animations from Blender; I'm sure there are plenty of tutorials that could explain it better than I can.

dusky lance
#

ok cool so it should be good with using rigify to create the armature, add animations and an empty, export it to unity via fbx and then i can attach objects to the bones at runtime?

small badge
#

I haven't used rigify myself, but yes, the rest of that sounds like it should all work.

dusky lance
#

sorry to bother you, but the animator component requires an avatar, i guess that the object or mesh it tries to operate on, is it enough if i just create one from the fbx import?

#

the wizard gives me an option there

small badge
#

The animator component does not require an avatar; if you're not using avatars you can just leave the field blank.

dusky lance
#

got it

#

thanks šŸ™‚

regal olive
#

hey wassup

orchid haven
#

I am being ignored :/

regal olive
#

wot

orchid haven
regal olive
#

well i have no idea

#

i started scripting yesterday

#

still dont have an idea on how to script

#

xd

orchid haven
#

all good, hope you enjoy your journey :)

regal olive
#

c:

gleaming thistle
#

Good news, I brought my 830+ line script down to 431 lines

regal olive
#

niceeeeeeeeeeee

gleaming thistle
#

Bad news, I broke it

#

lol

regal olive
#

oooooooooooof

orchid haven
#

tis the way

gleaming thistle
#

I still have the original

#

cos me smart enough to know me stupid

orchid haven
#

šŸ‘

gleaming thistle
#

I just don't know what went wrong

#

somehow it not only doesn't work as it did before, but it also is insanely laggy

#

so somewhere I mucked something up

#

but I can't find the issuee

livid kraken
#

Share the code or at least the problem sections

orchid haven
#

first of all, what is the purpose of the script?

gleaming thistle
#

I was working on making some kinda grid based pathfinding thing

livid kraken
#

A*?

gleaming thistle
#

it worked but the way I did it was much too slow cos I relied on physical objects rather than just the data of those objects.

#

I think some skewed version of BreadthFirstSearch basically

#

I tried to figure out A*

#

but it's over my head idk

#

Anyhoo the issue is definitely in the logic of the code somewhere. something doesn't happen in the right order or gets skipped or somethin

orchid haven
#

send the code please, or at least what is relevant

#

also please explain in what way it appears broken to you, what is happening?

gleaming thistle
#

it begins as usual, spreading out from the player, and avoiding walls

#

but then it just nearly crashes the longer it goes, and if it does reach the end, the path never seems to get loaded

#

the biggest change aside from using data vs a gameobject is that I store all the data when it loads now, whereas before I generated the grid around the player

livid kraken
#

First tip

#

Dont use coroutines for this

#

They have significant overhead that slows things down. I once "inherited" a dungeon generator that was using all coroutines. Getting rid of them and making normal method calls got the generation down from 390 ms to around 2ms

gleaming thistle
#

huh.

#

but I am like, looping through vast amounts of data

livid kraken
#

I see no reason for your methods to be coroutines anyways

gleaming thistle
#

wouldn't there need to be some wait time

#

otherwise it could just crash, no?

livid kraken
#

No thats not how it works

#

It would crash if your loop is infinite

gleaming thistle
#

it is potentially very large though. idk, I'm still new to this tbh.

livid kraken
#

Try it UnityChanThumbsUp

gleaming thistle
#

so are you fr saying I should take my IEnumerators

#

and make them voids

livid kraken
#

Yes

wicked bear
#

I can't say I've profiled it but that seems a little odd to me.

small badge
wicked bear
#

That makes sense. I definitely don't see that being a common enough thing requiring the banishment of coroutines/ienumerators from one's code though.

gleaming thistle
#

that did not appear to work

#

I mean maybe I'm wrong but somehow it seems like it didn't quite work properly

#

just a hunch lol

tough tulip
gleaming thistle
#

it's the only way I've managed to make it work

#

idk

tough tulip
#

Looking at it you might not even need a complete Coroutine. You can make use of voids as you're not yielding anywhere.
Although the execution of void could be controlled by a Coroutine for cases where your method takes too long to execute and you feel like timeslicing that

gleaming thistle
#

my dude

regal olive
#

ye

violet schooner
#

look at line 21

hushed fable
regal olive
#

oke

#

oops sorry, didnt see i was in advanced

#

sorry

rapid sky
#

@sly grove it works perfectly now, no tunnelling at all

#

thanks for the help

grand falcon
#

Hello i am creating a multiplayer 2d game but have noticed that after a few seconds of play time it starts to lag a bit. From a profiler I can see that Physics and others are filling up the cpu like crazy :(. Can anyone recommend how I can resolve this ?

thick thorn
#

Optimizing is very fact specific so it’s impossible to say without looking at your code, etc.

grand falcon
#

What would be the best way to approach this and fix it by myself? @thick thorn

thick thorn
#

well firs tyou can click on any frame to see what methods are actually causing the spikes

#

then you need to go into those methods and look at what things might be happening.

#

you can do deep profiling with markers if you can't figure it out through intuition

#

you might also want to turn on the garbage collection view in the profiler to see if you're allocating too many things

#

point is though it's hard for anybody to tell you what's wrong without knowing more about your project

grand falcon
#

That is actually what I've been trying to do but I guess I need to get more knowledge in this area.

I get your point and I do understand that. Was hoping for a magic fix anyway šŸ˜‰ Guess I'll dive into this more and see if I can resolve it.

#

Thanks @thick thorn

golden saddle
#

General Unity question: Is it possible to create a separate UI that's only piped out to streaming services? What I'd like to do is have a UI that is oriented towards my player playing the game, but I'd like the output to be formatted for a better spectating experience (and even throw in the player's webcam in a non-obtrusive location). Imagine a Madden-Like game that the player played as normal, but the stream output was a view from the sideline, for example; or Poker where the player was able to hide their cards from the streaming audience.

tough tulip
#

You can make use of multiple cameras and target displays. tho I'm not sure about that in release builds

hushed fable
#

@golden saddle Don't crosspost.

sly grove
golden saddle
sly grove
#

That's up to you

golden saddle
sly grove
#

Make it webGL

snow grotto
#

I'm trying to get a point from a array or positions (Vector2), or a spline as you will, and I want to get a position from it based on a alpha, so if I input 0.5 I want to get the middle point of all the positions, what would be the best way to go about it?

sly grove
golden saddle
sly grove
#

How so

snow grotto
golden saddle
# sly grove How so

Literally, the point is to make a better twitch/youtube viewing experience. Sending viewers to an entire other client is the exact opposite of the point.

sly grove
sly grove
#

You have the twitch broadcaster join as a spectator

#

And they can stream it or do whatever they want

golden saddle
golden saddle
sly grove
#

Sure, they can spin up a second one in spectator mode.

#

Alternatively use Unity's multi window features

snow grotto
golden saddle
sly grove
#

Trying to save you a lot of grief

gleaming thistle
#

the issue I'm having is the pathfinding works fine, except if I set the worldsize too high it starts to lag like crazy. and it only happens when the pathfinding starts, not when creating the "world" in data.
https://www.toptal.com/developers/hastebin/kopefalece.csharp
if anyone could look this over and point out where there may be error in the logic, I thank you. I'd point you to where the problem is happening, but I haven't been able to figure that out.

only look if you have time, it's quite long and I don't wanna waste yalls time.
thanks in advance. I'll be trying to figure it out on my own for now lol..

#

@zenith ginkgo I posted it here. if you get the time and you wouldn't mind looking it over at some point, would very much appreciate. only if you want to of course.

unique ermine
#

Im not sure if it's possible, but is it possible to generate classes by existing classes?
For example. I need to save some Data in my game and I want to save it via JSON.

Right now lets say the class "Item"
I need to create a seperate class called e.g. "ItemData" which is pretty much identical besides having all attributes made for fitting in JSON.

At the moment I need to write it by hand everytime I want to save something new.
Is it possible to somehow automate this process?
So it auto creates a new class when I mark it somehow in one of the classes, and it auto parses the existing attributes to fit for JSON?
Can I write some logic for that?
Grateful for any information or source :))

gleaming thistle
#

pathfinding

sly grove
round pawn
#

hey, I keep getting "Kernel 'CSMain' not found."

#

When I set buffers and get data I only reference kernel '0' so I'm confused

#
void SetOrbitPositions(Vector3 pos, Vector3 vel, float mu)
    {
        int index = orbit_visual_compute.FindKernel("CSMain");

        Vector3[] positions = new Vector3[180];
        ComputeBuffer positions_buffer = new ComputeBuffer(180, 12);
        orbit_visual_compute.SetBuffer(index, "positions", positions_buffer);

        orbit_visual_compute.SetVector("position", pos);
        orbit_visual_compute.SetVector("velocity", vel);
        orbit_visual_compute.SetFloat("current_time", Time.realtimeSinceStartup);
        orbit_visual_compute.SetFloat("standard_gravitational_parameter", mu);

        orbit_visual_compute.Dispatch(index, 180, 1, 1);

        positions_buffer.GetData(positions);
        positions_buffer.Release();
        line.SetPositions(positions);
    }
#

Anyone? I'm having no luck with google

quaint narwhal
round pawn
#

Yep, that's the line

quaint narwhal
#

Someone says it might be a compilation issue

#

Or, you know... LOL

round pawn
#

Ugh

#

I guess I should find a HLSL debugger?

quaint narwhal
#

That might be your best bet lol

formal lichen
#

assuming it works with a simpler shader?

severe lance
#

Hey there, does anyone know how i could create and set a custom NavMeshPath to an agent? I'm generating paths inside a parallel job and have a list of corners but there does not seem to be a built in way to make a custom path.
however, unity docs state

Additionally, a path created from user code can be set for the agent to follow in the usual way.

#

the docs for NavMeshPath are conflicting, and say

These points are not set directly from user scripts

mortal ivy
#

I'm trying to convert an array of colors into a Texture2D and then into a sprite. But I'm getting this error. Despite my code being in the start function(I've also tried the awake function) any help would be greatly appreciated.
This is the error:
UnityException: SupportsTextureFormatNative is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'SpellWorks' on game object 'DefaultSpell'.
See "Script Serialization" page in the Unity Manual for further details.

And this is the code in the "SpellWorks" script

shadow seal
#

That is all the code?

#

There is no code anywhere else?

mortal ivy
#

Oh no there's a couple other scripts, but this is the only one with the issue it seems

shadow seal
#

I mean inside this class, that is everything in the class?

mortal ivy
#

Yep

shadow seal
#

So you don't have a class declaration?

#

We should see all of it

mortal ivy
#

Well besides the class declaration and variables

#

Aight 2 sec

#

Here's the complete class

shadow seal
#

Hmm

mortal ivy
#

I can't seem to find any info online, and I've checked the documentation but tbh i don't understand it

long ivy
shadow seal
#

Initialise the Texture2D in Start

#

Weird because I thought that would be valid

long ivy
#

no, constructors aren't necessarily called on the main thread and Unity API isn't thread safe

#

so no accessing any Unity API or creating unity objects in field initializers

mortal ivy
#

Yep. No error. Thanks so much, been at this for almost 2 days now lmao

regal olive
#

I have this code in my entitiesmanager class.
I have also bunch of calls to separate singletons on my entitiesmanager.entitydestroy method.
To avoid this, should I just make event entitydestroyed or something, and then invoke the event in the entitydestroy method so all classes can decide what they do and don't have to worry about this shit here?

   public void EntityDestroy(int uid)
    {
        Entity ent = GetEntityByUid(uid);

        if (MoneyManager.instance.prefabName_purchaseableItemData.ContainsKey(ent.shortPrefabName))
        {
            PurchaseableItemData data = MoneyManager.instance.prefabName_purchaseableItemData[ent.shortPrefabName];
            if (data.type == PurchaseableItemType.TROOP)
            {
                Server.clients[ent.ownerPlayerId].armySize -= data.increaseArmySizeBy;
            }
        }

        if (ent.buildingPiece != null)
            CastleBuild.instance.UpdateNavmesh();

        Destroy(ent.gameObject);
        bool success = entityList.Remove(ent);

        if (!success)
            Debug.LogError("Couldn't remove entity!");

        int ownerPlayerId = GetEntityByUid(uid).ownerPlayerId;
        uidEntitylookupDict.Remove(uid);

        if (Server.clients.ContainsKey(ownerPlayerId))
        {
            Server.clients[ownerPlayerId].clientIdOwnedTroopsLookupTable.Remove(ent);
            if (ent.shortPrefabName == "House_01")
            {
                Server.clients[ownerPlayerId].armySize -= Config.HOUSE01_ARMY_INCREASE_AMOUNT;
            }
        }
        else if (ownerPlayerId != -1)
            Debug.LogError("wtf ownerPlayer does not exist");

        ServerSend.EntityDestroy(uid);
    }

I am pretty sure that would be the best way but I want to hear someone's words who is wiser.

long ivy
#

I would, because you're mixing multiple concerns here. I would split this into several methods at the least

regal olive
#

Yeah so instead of going there to add new functionality everytime, I could just subscribe to the method

#

event'

regal olive
#

umm what

#

why do i always forget my semicolons

austere jewel
#

If you're missing semicolons and not immediately getting errors as you move to the next line you need to configure your IDE using the instructions in #854851968446365696 .
Also please don't use this channel to post basic questions.

golden saddle
golden saddle
# golden saddle Does your code actually Lag, or just execute slowly? GetNextTileInPath is an IEn...

Each frame you defer in a yield return null is the same as a frame referred to in "FPS". You're typical 3d shooter games might top out at 100 FPS - you're running 10s of thousands of instructions (each possible route in your 2d grid), one frame at a time, essentially pausing for the majority of a frame before moving on to the next iteration. So your processing speed is fundamentally being limited to Unity's FPS max and saddling your computation speed with the overhead of the entire project.

regal olive
#

Hey! I don't know if I'm in the right place to ask, but I wanted to import this DLL from VirtualBox, I can import and use the DLL on a regular windows form and everything works as expected, however in unity, I can reference the DLL in Visual Studio and it acts nice, but Unity itself complains of a missing directive / assembly reference. I have tried putting the DLL in a "Plugins" folder, root folder, etc, but nothing is working. The DLL is pretty complex and I'm not sure if extern will help me much here
The DLL comes from VirtualBox and is named VBoxC.dll (I can send it if needed)
Here is an example that works in Visual Studio when I import the DLL as a reference: https://gist.github.com/NotBMan/3c4d4cc0ce362fffdb5baa7f2ad0d0e6

Gist

DLL Help. GitHub Gist: instantly share code, notes, and snippets.

fickle inlet
#

does List and LinkedList work similarly?

#

Does the List traverse through nodes (node.next) like LinkedList?

small badge
#

I don't believe so; as far as I know List<T> is just a dynamically resizable array. Walks are performed by indexing, insertion is performed by copying later values forward to make room.

#

Whereas, as you say, LinkedList is a proper linked list.

gleaming thistle
#

I think there is some other issues with the code as well tbh, but what you're saying makes sense now that I think about it.
is there anyway that I can do this different? it really needs to be quite quick @golden saddle

#

if I try to run them all at the exact same time with no wait of any sort it'll wind up crashing

golden saddle
gleaming thistle
#

I'm not 100% sure what the full size is gonna wind up being.. but it's gonna be at least 500x500 for the map

#

it can take time to load at the start of the script, that's fine

#

but for when the pathing happens it needs to be quick

golden saddle
#

I would implement straight up classic A* pathfinding. Tried and true, 500x500 is big but doable.

#

but 100,000% you cannot use Coroutines/IEnumerators for this.

gleaming thistle
#

so just the act of running an IEnumetator will wind up taking a frame? I thought that was the whole point of Coroutines, to run many things at the same time or thereabouts

golden saddle
#

no, the exact opposite

gleaming thistle
#

wha?

golden saddle
#

ienumerators break operation for a frame, which can be useful for waiting for player input, for eg.

gleaming thistle
#

are you fr?

#

well that's awkward

golden saddle
#

French? no.

gleaming thistle
#

no no fr means for real.

#

internet talk

golden saddle
#

I'm an old.

gleaming thistle
#

all good

#

probably got a lot of coding knowledge then

#

so yeah, basically my understanding of coroutines is completely wrong?

golden saddle
#

Just starting out. But I watch a lot unity and C# videos.

gleaming thistle
#

tbh what you're saying makes sense, looking at it objectively

#

because it allows the rest of the script to run while waiting for the code in the coroutine to execute

#

I've misunderstood the point of them

#

I am trying to make a game but I would really like for me to be able to actually understand how the pathfinding works and how it gets there. been trying to not just copy paste things and just try and understand concepts

#

on that note, do void()s take a frame to run as well?

devout hare
#

no

#

and neither do coroutines

gleaming thistle
#

well now I'm even more confused

devout hare
#

At the start of each frame, all Update of active objects run each in turn, then all coroutines that are due to run are executed, each in turn. That's all there is to them.

#

(with some additional details that are irrelevant here)

compact ingot
# gleaming thistle on that note, do void()s take a frame to run as well?

The thing with all things computer science is that, if you go deep enough, everything is built from exceedingly simple principles. It is far easier to understand how to write a driver for a given chip than it is to write a game. All the complexity comes from people with their limited understanding combining them into overly complex systems. Pathfinding is extremely simple at the core, so are coroutines. If you encounter any concept in CS, and you find it difficult to understand… dig deeper and you will find a really simple concept from that the complexity derives.

fickle ether
#

Hi, is there any way to change packages source code? I found a bug on HDRP and i wanna fix it, but every time i change script it'll reset to previews data... it's because it's cache temp files... is there anyway to make them change?

compact ingot
fickle ether
compact ingot
#

unity will try to keep packages validated with their source (upm, git, local source folder) and assum they don’t change between versions

compact ingot
fickle ether
#

how can i make it clone?

fickle ether
compact ingot
#

Copy it to a new folder

compact ingot
fickle ether
#

but isn't gonna that be a problem in future... i mean i'm always keep updating it !

#

can i update to new HDRP version for example ?

compact ingot
#

yes, that’s why people don’t fork the render pipelines

compact ingot
#

if you found a bug, have unity fix it

fickle ether
#

hmmm i've got... so after copying it to a new folder... i just need to add it to assets folders and then remove the original one from packagemanager right?

fickle ether
compact ingot
#

In theory

fickle ether
#

but i can't wait anymore... i can fix that by my self, i found the solution

compact ingot
#

For sanity sake, try to not depend on fancy features outside LTS releases

#

also don’t use stuff that has bugs

fickle ether
#

you're right... it was so stupid of me that i changed my main project version to those versions

fickle ether
compact ingot
#

I’d be very reluctant to depend on anything in the SRPs too heavily… they aren’t done yet

#

if you look at the asset store… URP is a way more popular SRP

fickle ether
#

i know... but High Definition of graphic is important in my game... so i choose HDRP as my first PC game, and it really looks good... when anybody sees it, they think i made it in unreal...šŸ˜…

compact ingot
#

you can do great graphics in URP too

#

it’s more about art direction than render features in the end

fickle ether
#

can i have raytracing in URP too?

tribal narwhal
compact ingot
#

nobody can afford raytracing GPUs

tribal narwhal
#

And boy is HDRP driving me crazy!

tribal narwhal
fickle ether
#

yesi know... but it's good to put it as an option in your game

tribal narwhal
#

That’s what I’m saying

compact ingot
tribal narwhal
#

HDRP is driving me crazy!

fickle ether
fickle ether
compact ingot
#

Hdrp is great for deferred lighting, not much use for anything else imo

#

i have come to love the lighting limits of forward rendering

#

Keeps my projects focused on what’s important

tribal narwhal
#

Does anyone know how to fix an issue where volumetric clouds is causing everything to break?

#

Like when switching scenes

#

From one that has it to one that doesn’t and back?

fickle ether
# compact ingot Keeps my projects focused on what’s important

you're right... that good if you have some really good skills on game designing... but i worked with Unity since Unity v.3, so i decided to make my last game in my life, after this i probably just focus on materials and lighting... you say very right my friend, thanks to you

fickle ether
tribal narwhal
#

It’s the first time it is happening

fickle ether
#

witch HDRP you using?

#

hmmm let me see....

tribal narwhal
#

12.1.2

tribal narwhal
compact ingot
#

pre unity 5, life was simpler

fickle ether
fickle ether
compact ingot
#

in unity 1/2/3 we were just happy to have something render in 3d at all

tribal narwhal
#

Yes through the game I have several other volumes

#

*scene

fickle ether
compact ingot
#

that was a pro feature

fickle ether
tribal narwhal
#

Wait let me try disabling one of the volumes

tribal narwhal
#

Nopes still doesn’t do it

#

I found however disabling the volumetric clouds at runtime I’ve tried does indeed ā€œfixā€ the issue

#

Somehow like disabling and re enabling it

fickle ether
#

it's the ordering... sounds like you have two objects or volumes that may be the same property... and it's get bugs

#

just like some of my lights... they had two Light data due to prefab workflow bugs

tribal narwhal
#

Well I do have 3 volumes that are simile but only 1 is active at any given time

fickle ether
#

hmmm, i wish i could fix it, but i don't know how exactly your game is... the algorithm i mean... i have multiple volumes too, but no errors

#

this is my visual environment

#

and this is the cloud

tribal narwhal
fickle ether
#

and the exposure

tribal narwhal
#

Like the problem happens when i switch scenes

#

i mean if i go on the scene with all those effects and restarts unity

#

everything will be good

#

but if i switch scenes and go to another without it, then go back to this one, it will break

fickle ether
#

wired... i switches too...

tribal narwhal
#

yh i know

#

i have to submit this game to a jam today, the last day

fickle ether
#

maybe it's because you enabled local clouds?

tribal narwhal
#

idk, let me try without it

fickle ether
#

and i was going to release the game too šŸ˜… 😩

#

big lesson... never leave the LTS version

tribal narwhal
#

lol😫

#

yh

fickle ether
#

this is my result without local cloud and it's better i guess

tribal narwhal
#

Does that help to know that i am actually instantiating the whole scene with the effects at runtime?

#

like the whole scene is a prefab

#

(For loading time, i have it instantiated, so it takes up less time to load and the game doesnt freeze)

fickle ether
#

well prefabs are making problems most of times

#

i just told you that i had lights with two different LightData component

#

and it's all because of prefab

tribal narwhal
#

😩

#

I remove it from the prefab then?

fickle ether
#

don't make your volume as a prefab

tribal narwhal
#

ok let me try

fickle ether
#

yes i guess, it may fixs

#

prefab got still bugs with overrides components... i think that's the problem...

tribal narwhal
#

wait, testing rn

#

yups in fact it did work!

#

thanls

#

but im having my lights flickering now

#

let me restart unity

tribal narwhal
#

Wait

#

but that doesnt explain why when i switch scenes it breaks everything

#

i have unpacked everything and is is causing similar problems

fickle ether
#

what happend?

tribal narwhal
#

I unpacked everything from the prefab to the scene

#

and the scene goes like as if i have increased the exposure by 10 or 20

#

i enabled Local Clouds then disabled and enabled the volumetric clouds again and it fixes everything

#

problem

#

normal

#

if i do not restart the volumetric clouds after enabling local clouds

fickle ether
#

what about sky options...

tribal narwhal
#

Wait I am recording something to show you the problem

compact ingot
fickle ether
#

when you made them in prefab, it may broke some data, and unpacking them... well i don't think it's gonna fix them, i bet after unpacking they must re register again

tribal narwhal
#

Sky

tribal narwhal
fickle ether
#

ohhhh i found out the problem... i have the same... but not like you... i mean i don't get the exposure issue... i can see it a little in my scene

tribal narwhal
#

Oh really?

compact ingot
tribal narwhal
#

You are a life saver!

tribal narwhal
fickle ether
#

look when you loading a scene, the coulds need to re bake as lighting in your scene lighting... try use static lighting, it may fix the issue

compact ingot
#

Hdrp sux

#

šŸ˜ž

tribal narwhal
#

wait let me see

#

Do you guys know any way i can speed up scene loading? Ill have to find another one since instantiatign the whole scene at runtime is causing HDRP to break

fickle ether
#

that's happen because it's bakes the lighting, not that kind baking thou... i mean, it's like physically based sky

tribal narwhal
#

nopes

#

didnt work

#

still same error

#

should i change anything here?

fickle ether
#

if you wanna add RTX components to your game try to add them in different volume

#

and also different HDRP pipline asset

tribal narwhal
fickle ether
#

i'm sure your problem is the environment lighting, just try to find out to bake clouds first before anything...

tribal narwhal
#

wait

fickle ether
#

hmmm... also try use static ambient mode in visual environment component, it may fix

tribal narwhal
#

ok

#

nopes

#

still didnt help

fickle ether
#

hmmm i don't know anymore... what you think of URP šŸ˜† šŸ˜†

tribal narwhal
#

I have to submit that game by today midnight!😫
For a jam!

fickle ether
#

i'm sure you can fix it, if it didn't fixed at all, try to disable and enable the volume to rebake the lighting by script

tribal narwhal
#

found somethind

fickle ether
#

or with an time line animation or something...

tribal narwhal
#

This as well seem to have an effect

tribal narwhal
fickle ether
#

told ya, it's ambient lighting...

#

so it's HDRP's bug then...

#

order of bake... hhmmmm.

tribal narwhal
#

how do i fix it?

#

i really need to have it fixed by midnight else im dead lol😫

fickle ether
#

if it can fixed by disabling and enabling, that use some code or animation to do it in play mode, i guess this is the only way for now

tribal narwhal
#

yh let me try that

fickle ether
#

no your not dead, at least you can don't use clouds right?🄲

tribal narwhal
#

no even then

#

it happens the error

#

🄲

fickle ether
#

well... my unity just crashed with DX12 šŸ˜…

tribal narwhal
#

lol

#

Does anyone else has a fix to this?

#

Why is it happening only when switches from scenes that has this effect to other that don’t tho. I mean it’s strange

#

And why now! This morning everything was fine!

#

😭

fickle ether
#

is this supposed to only work on build version? but it's not... so what am i missing?

tribal narwhal
#

Try this way

#

The workaround kinda worked. Lol

drifting galleon
#

why don't you just screenshot

tribal narwhal
#

Yhhh….. I actually was on my phone my badšŸ˜…

compact ingot
#

why don't you just copy paste?

stark shore
#

My ActionStep class is being serialized but the ActionStep_Part class i drag into it is not being serialized. Any idea why?

drifting galleon
tribal narwhal
drifting galleon
tribal narwhal
drifting galleon
#

monobhevaiours do not need serializable btw

stark shore
#

i added the monobehaviour so i can actually drag it into the inspector. Is there another way I can do it?

fresh salmon
#

A class should not be deriving from MB if you don't intend on attaching it to a GameObject directly.

drifting galleon
#

that's probably not what you want if you don't actually have it attached to a GO. use a scriptable object instead

stark shore
#

if i use scriptable object, can i change the values individually in this inspector and not affect the original scriptable object?

#

This is what it looks like without Monobehaviour. I want to be able to drag in different subclasses to this list that all derive from the same base class.

drifting galleon
#

or if you just want data, just use a simple class

#

then you don't need to drag anything cause that wouldn't even make sense to do

stark shore
#

But they each need to be different. for instance:

#

they all have the base class "spell", but i drag in the different parts that all derive from the class "spell", such as Spell : Travel, Spell : Prefab etc

#

Every spell is different, so i want to be able to only drag in the parts i need

drifting galleon
#

uhhh, you probably want to look at the decorator pattern and i am confident that you will definitely have to write a custom inspector for that

stark shore
#

decorator pattern. Thanks for the tip! I had no idea where to look next

stark shore
#

particularly, I cant figure out what 'target' is

drifting galleon
stark shore
#

And what is target to begin with?

#

Why is that line necessary?

#

When i remove it, the code breaks, so i know its for something.

drifting galleon
#

target is the instance of the type which you are building your editor for

#

you know. the target

#

which you are targetting

stark shore
#

ah! okay. And so it just needs a reference somewhere.

#

Where should that reference go? at the top of this script?

drifting galleon
#

wdym?

stark shore
#

Its in error state

drifting galleon
#

whats the error?

stark shore
#

I assume because target isn't referenced anywhere

round pawn
#

Hi, I've been trying to get a compute shader to calculate points in an orbit to display on a LineRenderer. I'm getting a bunch of errors:

  • Invalid worldAABB. Object is too large or too far away from the origin.
  • Invalid localAABB. Object transform is corrupt.
  • Assertion failed on expression: 'IsFinite(outDistanceForSort)'
  • Assertion failed on expression: 'IsFinite(outDistanceAlongView)'
  • Invalid AABB a

Here's my compute shader: https://pastebin.com/a0GzHrzy
And here's my C# method: https://pastebin.com/1SdrXjKn

Ping me if you notice what's causing it to only output NaN, thanks

stark shore
drifting galleon
drifting galleon
# stark shore

target exists already. it's just telling you that it can't convert it to actionseries

stark shore
round pawn
drifting galleon
drifting galleon
stark shore
#

oh!!!!! I see it now.thank you. I thought target was a thing he made up. Editor has target built into it

round pawn
#

Getting really frustrated that there's no good way of debugging compute shaders

stark shore
round pawn
#

If anyone knows a good way to debug compute shaders let me know

drifting galleon
#

maybe that can help you

round pawn
#

I'm working with float3s rather than graphics, so it's not the same

#

I don't even get any meaningful data from it, it's just an array of (NaN, NaN, NaN) vectors

#

No clue how to make it work