#archived-code-advanced

1 messages · Page 19 of 1

sinful fossil
#

I am aware I can do this with extensions btw, i am curious if you can do it inside the class thought

flint sage
#

Assuming I understand, you could do this but that would require you to instantiate TestColor instead of Test1 which is probably not what you want

class Test1<T>
{

}

class TestColor: Test1<Color>
{
    public void Blur()
    {

    }
}
#

Otherwise extension methods is the way to go

sinful fossil
flint sage
#

Yeah in that case, extension methods

hardy nymph
#

is it possible to convert euler angles to quaternions in javascript ?

flint sage
#

It's just math so why not

hardy nymph
#

Oh okay

#

I will try

cerulean scaffold
#

DOTS physics is also deterministic (on the same machine)

ashen shard
#

While you could do this with extensions, you generally want generic classes to be, well, generic. If you're changing behaviour depending on the type there's probably a better option.

wintry wind
#

Hi. I’m making a physics based spaceship game where ships are rotated by torque. To make sure enemies can aim correctly and not overshoot, I use PID controllers. It works very well enemies have very good aiming.
The problem is once I start the design process of tweaking the torque power of the enemies, the pid controller is broken and the controllers need to be tuned. This makes the iteration time painfully slow

#

Has anyone dealt with a similar issue? I’ve used a genetic algorithm to automate PID learning but it takes 10mins with the computer at 100% so iteration is still slow

#

I’m considering if PID controllers are the best solution

compact ingot
#

at the end of the day what matters most is game feel and correct physics usually get in the way of that.

wintry wind
#

I think there’s a holy grail somewhere in this problem though. I think there should be a way to automatically tune (ie deterministic, without genetic brute force) PID controllers based on the max angular acceleration. I’m just not good enough at math to figure it out lol

#

Realistic and feeling good movement are pillars of this game and why I invest a lot of time in it

compact ingot
mint sleet
#

Hello!

#

My managers are derived from the same base class. I can not assign them to base classes' array field.

austere jewel
#

You're not dragging an instance into a field. They must be instances of components or scriptable objects to be serialized references.

mint sleet
#

hmm I'll initialize them via constructor then. @austere jewel

austere jewel
#

If they're not UnityEngine.Object types, that's definitely how you do it

mint sleet
#

Thanks!

snow flint
#

hi guys, trying to use reflection to call a method on a class but getting this error that is commented in the code, but sure what it means tbh..

        {
            Type myType = typeof(UnitStats);
            FieldInfo myFieldInfo = myType.GetField(statInfo.Name, bindingFlags);
            if (statName == statInfo.Name )
            {
                // ArgumentException: Field moveDistance defined on type UnitStats is not a field on the target object which is of type System.RuntimeType.
                object myObject = myFieldInfo.GetValue(typeof(UnitStats));
                MethodInfo myMethodInfo = myObject.GetType().GetMethod("");
                object[] args = new object[] { percent };
                myMethodInfo.Invoke(myObject, args );
                return 0;
            }
        }
        return 0;```
austere jewel
#

(if the member is static that instance is just null)

snow flint
#

right that makes sense, the instance isn't static, need to think what this instance should be i think i know it

#

thank you

timber flame
#

I have octree GetNearBy method by max distance (radius) but I want k-nearest neighbor. How can I change it?
Because finding neighbors using radius sometimes for example returns 3 points and sometimes 100! It is not fixed
Do I have to sort the result or add them in a heap (priority queue) when finding them?

kLog(n)
n: number of result points
k: number of nearest points

snow flint
austere jewel
#

It returns an object, you just need to cast it to the type you're expecting

#

(or keep it as object if you don't know what it is)

snow flint
#

oh of course, ok thank you

cerulean scaffold
#

Hi everyone, when I assign a value to a float without any calculations, like for instance
float myFloat = 7071077f, it should always be exactly the same value on different x64 machines, because floats are 'accurate' by up to 7 digits, correct?
(And if I would assign a value with 8 digits, float myFloat = 70710771f it wouldn't always be exactly the same value)

sly grove
cerulean scaffold
cerulean scaffold
#

For floats with more than 6 digits he's using hexadecimal values like this

public static sfloat FromRaw(uint raw)
    {
        return new sfloat(raw);
    }```

sfloat k_cosMaxMergeAngle = sfloat.FromRaw(0x3f3504f7);```

devout hare
#

Seems to be quite a lot of conceptual/terminology misunderstandings here

#

if something is accurate up to N digits, it means by definition that it's inaccurate after N+1 digits

#

so if you have numbers 0.70710701f and 0.70710702f they're both accurate to 7 digits but not the same number

#

That said, I'm pretty sure (but not certain) that float constants are the same everywhere. The issues come from operations like addition (0.2 != 0.1 + 0.1)

cerulean scaffold
devout hare
#

At least that's what the soft floats library thing assumes

cerulean scaffold
#

But for large numbers he uses hexadecimal values in his code

devout hare
#

I don't see any evidence of that?

#
sfloat a = sfloat.FromRaw(0x00000000); // == 0
sfloat b = sfloat.FromRaw(0x3f800000); // == 1
sfloat c = sfloat.FromRaw(0xc2f6e979); // == -123.456
sfloat d = sfloat.FromRaw(0x7f800000); // == Infinity
#

0 and 1 are not large numbers

cerulean scaffold
#

so he uses sfloat.FromRaw()

#

But for values like 2.0f he simply casts to sfloat

devout hare
#

That might be just a style issue, or the reference values come from somewhere. You'd think that it would be mentioned in the documentation otherwise.

cerulean scaffold
#

Idk, should I notice that casting floats with lots of decimals to sfloat not being deterministic I'll give FromRaw() a try 🤷‍♂️

undone coral
# mint sleet

VR Cloud Manager
you're on the start of a very, very long journey

#

i forget, the plugins, are they streaming something? data or audiovideo?

undone coral
#

there is a lot of gameplay that works with that

#

with those constraints*

#

it's networked right, that you're after, not necessarily deterministic?

cerulean scaffold
undone coral
#

as a single player game or multiplayer?

cerulean scaffold
undone coral
#

oh no

cerulean scaffold
#

nah

undone coral
#

that's Skyteks he's actually in this server lol

spring lake
#

Is it possible to convert a world position to screen position even outside the camera frustum?

Sometimes, the built-in functions returns some weird numbers so, is there a workaround for this? This is somehow related:

https://forum.unity.com/threads/worldtoscreenpoint-bug-returning-huge-numbers.536564/

But I don't intend to do the same thing. I'm trying to get the screen coordinates of the 4 corners of a plane without clipping the results.

wintry wind
mighty viper
#

PLEASE! Is here anyone who can help me with netcode? I'm loosing all my braincells!!!

fresh salmon
mighty viper
undone coral
#

i am not 100% sure why it occurs. I used to believe it happens because the camera is moving

wintry wind
#

I think it happens when you get close to the 90deg angle to the camera

#

Because if you think about it 90deg from the camera would be infinite

spring lake
spring lake
visual shore
#

hi, not really advanced but other channels seem to be in use, i've created a scriptable object but it won't show up to be created despite the [CreateAssetMenu] attribute and i have no idea why

visual shore
#

thanks :) i just thought i should wait a bit in case someone replied to the one above

upbeat path
upbeat path
visual shore
upbeat path
visual shore
#

yep had a code error in another script thank you!

upbeat path
inland prairie
#

Hello, I just noticed in my code I have some reference to GameObjects that are active (activeSelf = true, activeInHierarchy=true) but they do not exist or are not visible in the Scene on the Editor.
Such reference is a static reference to a GameObject

static GameObject cameraObject;

I wonder if somebody can help me understand what is happening here.
Thasnks!

sly grove
#

Also

#

is it a prefab:?

#

Prefabs don't exist in the scene

inland prairie
#

hideAndDontSave

sly grove
#

that's why you don't see it

inland prairie
#

duh, that makes sense, I didnt know you could set flags to a GO to hide it on the Scene

#

thanks for the clarification

mint sleet
undone coral
#

lol

#

gotchya

little trench
#

Does anyone have any experience with digitally signing unity .exe files on Windows 11? Would like to get rid of that ugly "don't trust this software" screen.

#

Main question is if you need a cert from a CA, or if you can self sign?

#

wow, these bloody certs are expensive!

regal olive
little trench
#

hundreds of dollars

regal olive
#

Also how do those thousands of games on steam for example not have that?

#

They certainly dont just buy certs right

little trench
regal olive
#

Ah

little trench
#

I'm distributing on itch, I haven't looked into Steam, but my understanding is its a pretty involved process to put something on Steam.

regal olive
#

Still sucks though if you wanna let people buy/download from your own site

little trench
#

doing a little more research, I'm wondering about the implications of signing a project with an IV cert, or if you even can? I don't currently have a business license.

regal olive
#

Isnt there something like certbot, which is for ssl, but for applications? UnityChanHuh

little trench
#

I answered my own question. With anything less than an EV cert, you have to have thousands of downloads verified to build reputation with Windows Defender Smartscreen, and not see the warning message. With an EV cert, you get automatic recognition.

#

It looks like you can qualify for an EV cert as a Sole Proprietorship. You would need to get a DUNS number, or a letter from a CPA.

#

Honestly, I'm going to do some research on deploying XR Interaction Toolkit apps to Steam VR. That might be a lot cheaper, and less legally fraught.

#

(talking to myself at this point, sry!)

regal olive
#

Duns number uuuhh yeahh no idea lol

#

Just let 1000ppl test ur game i guess :S

mint sleet
#

Hello!

#

What is the best way to store API endpoints in unity? I want to put them all into a static class as constvalues. Is this approach ok?

#

I have almost one hundred APIs

pliant crest
tidal solstice
# mint sleet What is the best way to store API endpoints in unity? I want to put them all int...

we used that approach for a multiplayer game at my old company. we had about 20-30 endpoints written as constants in a static class. you can make nested static classes for different categories of endpoints, so the code is easier to read and navigate through

it worked out fine for us. the endpoints all had the same base URL, which we stored as a separate constant that was referenced by them (easier to change from development to live APIs and vice versa).
the main thing to watch out for is not to publish builds with the wrong base URL (for this, you could consider a configuration file or something similar)

pliant crest
#

i could understand that being a config file or something

#

but wouldn't you just wrap it in a repository

#

why have statics

#

if anything it would be constants in the repo

#

or a scriptable object

tidal solstice
#

if all he needs is a place to get some unchanging URLs from, a repo is superfluous, imo.

a SO is a good option too, and it's more editor-friendly, but then you have to keep a reference to it somewhere so you can access its values

scenic sapphire
#

Hey, i wonder if you can overwrite in an extended class a field from the base class

#

So if i have ItemPicker with an Item type field. Create an ItemPickerExtended with ItemExtended field (without creating additional fields)

gaunt spoke
#

I'm not sure thats a thing, you can use Item base type in ItemPickerExtended and use

if (item is ItemExtended itemExtended)
{
  itemExtended.DoExtendedStuff();
}
hearty venture
#

@scenic sapphire u cant override fields, only methods, you can technically hide an inherited field by doing something like:

public new bool ShouldHide = false;

in the derived class, this will cause an error if both the base and derived class serialize said field.
Alternatively if the 2 fields have the same base class then just keep the one in the base class.
For example:

public class A
{
    public Item item;
}

public class B : A
{
    public ItemExtended _item;
}

A.item can store instances of ItemExtended but B._item can only store ItemExtended not Item

scenic sapphire
real plume
#

hello. i was told by phota to ask here: why
Debug.Log(cellDict[tileLocation].Position); reports position
but
Debug.Log(cellDict[tileLocation] == null); reports true ------- here is code, sorry in advance for all the comments but i figured it was better not to delete bc then our lines wouldn't line up http://pastie.org/p/00uBFlm9AK1ihr1j7QmaoR

flint wraith
#

yeah, this part specifically

#

last 2 lines, first debug reports true but last line can get position

real plume
mint sleet
#

I have written the API as monolithic with 3 physically separated layers. But have not seen any example how to communicate with the backend in Unity in this way

#

That is why I am making a library that consists of managers and a general manager, to make the unity frontends job easy, they all will be using only Unity Objects to interact with the backedn.

hearty venture
#

@real plume what happens if you use a single Debug.Log?

mint sleet
#

Ill stick to this approach!

pliant crest
#

you mean rest apis right?

#

or graphql etc...

mint sleet
#

yes, rest apis

pliant crest
#

have you heard of the repository pattern?

mint sleet
#

not for unity

pliant crest
#

don't think it matters if its unity or not at that point

#

cause repositories normally get DI'd but you can't do that in unity

#

so i guess you just hold it in a some sort of reference object

mint sleet
#

but there is no DataAccess layer in unity since Unity won't be calling DB functions.

pliant crest
#

its not necessarily just for sql data

#

the datasource can be from anywhere

#

like rest apis

mint sleet
#

hmm. have not thought about that. you re right!

pliant crest
#

its why repos are normally interfaces

#

base implementation + concrete where ever the data is

mint sleet
#

but then the responses of APIs matter a lot. They need to be in the same pattern and a very good error handling should be done.

#

otherwise the unity side blows up. Am I right?

pliant crest
#

then you need single point of entry

#

that has a validator that runs through

#

generally i would use fluent validation but have nfi whats supported in unity

mint sleet
#

I used fluent too in the backend

pliant crest
#

why is it 100 api end points btw?

#

i'm sure you can break it down into multiple parts

mint sleet
#

No we have about 40. its just exaggeration 🙂

pliant crest
#

fair enough

rugged radish
real plume
mint sleet
#

thanks @pliant crest

#
        public class OnLoginAttempt : UnityEvent<bool, float> { }
        public class OnLogoutAttempt : UnityEvent<bool, float> { }
        public class OnOTPSendingAttempt : UnityEvent<bool, float> { }

        public readonly OnLoginAttempt onLoginAttempt = new OnLoginAttempt();
        public readonly OnLogoutAttempt onLogoutAttempt = new OnLogoutAttempt();
        public readonly OnOTPSendingAttempt onOTPSendingAttempt = new OnOTPSendingAttempt();```
#

Is there any way how can I pass an object that is derived from UnityEvent as an argument to be invoked

real plume
hearty venture
#

that way you make sure that your logs aren't coming from different instaces, positions on the array etc

gaunt spoke
#

is it possible that the comparison to null actually creates the entry and then your second log returns the position due to a default position value or smthing ?

hearty venture
flint wraith
#

i think problem is that CellData was inheriting MonoBehaviour

#

so == null was checking does it have gameObject

#

we are testing that now

hearty venture
#

then again if they would be structs wont return true on == null i think

flint wraith
#

this is class

#

so new CellData(); doesnt create object

sly grove
gaunt spoke
#

ah you are doing new() on a monobehaviour, it has never done any good

sly grove
pliant crest
#

nono

sly grove
#

But yeah new with MB is no good

pliant crest
#
var cell = new CellData()
{
  Index = ...,
  etc...
};
cellDict[tileLocation] = cell;
sly grove
#

Either way

#

Use a variable

#

Don't you get tired of writing out cellDict[tileLocation] 80 times?

pliant crest
#

.Add might be viable if you care about collision

#

as this just inserts or overrides cellDict[tileLocation] = cell;

flint wraith
#

this part not important right now

#

it was variable at first

sly grove
#

Making a variable would never have been the problem

pliant crest
#

(ps if you are lazy and need to show a whole object in debug you can just convert it to json)

#

or you know use a breakpoint

rugged radish
pliant crest
#

you could technically

#

if (object is null)

#

which bypasses that

rugged radish
#

even is null behaves weird in that case

pliant crest
#

probably

#

it shouldn't be a monob in the first place

flint wraith
#

but CellData never should have been monobehaviour as it only stores data about cell

pliant crest
#

the monob class should be separate from the data class

flint wraith
#

which is in dictionary

pliant crest
#

whats the standard for hiding an object that needs to be hidden unhidden alot?

hearty venture
#

@flint wraith just noticed that ur snippet of CellData didn't contain the declaration for Position

flint wraith
#

and code is not mine

#

trying to help aes0p

upbeat path
pliant crest
#

i remember vaguely when i was doing unity in the past it was a bad idea to spam this thing

upbeat path
#

there is a performance cost for everything, you need to see if that is worth paying in your particular case

pliant crest
#

welp

#

i guess i'm gonna cheat

#

and throw it out of bounds then

#

thou might be the same as disabling the renderer hmm

hearty venture
# flint wraith trying to help aes0p

@real plume in my experience issues like this usually mean that the Debug.Logs are coming from different places/instances/places in loops hence my suggestion on placing all the info in one Debug.Log, and you should fix the new CellData() issue mentioned by others, it can definitely cause weirdness, either use AddComponent instead or (temporarily) make it so doesn't extend MonoBehaviour

devout hare
#

There's no point in trying the roundabout ways before measuring the "correct" way

flint wraith
#

Is it really that impactful? make it changeable easily. at end of project if causes lots of slowdown i would then look into it and optimize. seems like that is optimization that doesnt mean much

real plume
rain flicker
flint wraith
rain flicker
flint wraith
#

yeah

#

dont know what [ReadOnly] means

#

but that code should work

#

you can try now creating third script and see what you can access and what you can change

gentle topaz
#

To me, that looks like a normal get / set property with extra steps, but maybe I'm missing something

flint wraith
#

yeah but that was question

rain flicker
#

[ReadOnly] mens that this value cannot be changed from editor

#

But this doesn't really fix my issue. I want to block the possibility of changing this value at all from other components other than the "owner"

flint wraith
#

well value now cant be changed except from HealthSetterSO script or HealthSO

rain flicker
#

But you could reference HealthSetterSO instead of HealthSO

flint wraith
#

new script shouldnt be able to change it except through HealthSetterSO

rain flicker
#

And still get away with changing this value

flint wraith
#

then remove sethealth from HealthSetterSO

gentle topaz
hearty venture
gentle topaz
#

At least, in any sensible way

#

You want to be able to change it externally, but only from some one unrelated script

rain flicker
flint wraith
#

that way you know only setter is changing value

gentle topaz
rain flicker
#

Or at least make it very hard

flint wraith
#

think its not smart and possible.
you can make it const or readonly that way it cant be change but why make health readonly

#

or as i said, make health private and have public getter and setter that way only setter changes values

rain flicker
#

Well, I think that it would be good for only one component like HealthController to change this value

flint wraith
#

well then as i said, make health setter protected

rain flicker
#

I expressed myself incorrectly

flint wraith
#

and HealthController inherit HealthSO

rain flicker
#

It should be possible to change this value only from one MonoBehaviour

gaunt spoke
#

I guess you can use an interface like IHealthSetter and pass the setter object as a parameter and check in the set if the setter has the IHealthSetter interface, if yes, accept the change, but tbh I would just let the other script change the health if they want, its too muc hwork

flint wraith
#

then only healthcontroller can change it

real plume
rain flicker
flint wraith
#

then cant help you

rain flicker
flint wraith
#

i mean part of your question is, is this good practice, honestly no

rain flicker
flint wraith
#

bigger projects rely on readability, this wont help it

pliant crest
#

cheat + good practice = ...

rain flicker
pliant crest
#

not enough context

#

answer unknown

#

like the hell is an important value

rain flicker
#

I would like to avoid a situation where a HealthBar has the ability to change player's health

pliant crest
#

player should change players health

#

something like

rain flicker
#

Exactly

pliant crest
#

playerInstance.TakeDamage(someDamage)

flint wraith
#

why would you cheat yourself? and why not have HealthController as SO?
What you are asking requires it to be that way, if you want just to read value you pass HealthSO if you want to chanage and read, you pass HealthController
to UI elements you pass HealthSO

rain flicker
#

But I would like to pass the current value of player's health to the UI script via SO

pliant crest
#

wait no

#

that doesn't make any sense

rain flicker
pliant crest
#

scriptable objects are for immutable data

#

just say you can't do that

#

and move on

#

like it makes no sense to

rain flicker
pliant crest
#

just because you can

#

doesn't mean you should

#

atleast during runtime

#

whats the benefit of doing this anyway?

flint wraith
#

As I said, You make variable private and setter public, if there is case that someone is changing health and you dont know where from. you add debug.log to setter and it show you callstack, shows where from is called

pliant crest
#

you have an additional middle man for no reason

lament salmon
rain flicker
#

Connecting different systems through editor

#

There are a lot of fancy tricks that you can do with SO

#

And they are great

pliant crest
#

it sounds like you want to fake ECS

pliant crest
#

like if you change a value

#

its persisted

#

you don't get a base version of it again

rain flicker
#

That's just something that you have to remember about

pliant crest
#

yeah you are retrofitting something to your needs

rain flicker
#

You could save those values in a file and load them back

obsidian glade
# lament salmon everyone keeps saying this, but why not?

using SO's for dynamic runtime data is just an unnecessary can of worms - their behaviour changes between editor and builds, in the editor they can persist between plays, can be overwritten, and wont function that way during a build. If you're using them during runtime they don't really do anything that a normal class wouldn't

pliant crest
#

just use ECS if you want to do decoupling of data

#

the argument is fine if you do it for everything

lament salmon
pliant crest
#

instead of just one thing

#

like i'm all for decoupling of data

#

just not like this

rain flicker
pliant crest
#

sadge

obsidian glade
pliant crest
#

theres just lots of edge cases you gotta remember basically

rain flicker
#

I think that those are just the two xd

pliant crest
#

fair

#

i actually can't think of another

#

(i don't use SO's myself)

#

well thats a lie

#

this project right now is the first time i used them

lament salmon
#

stop shitting on SO's just because you heard they are bad lol

#

theyre really good for shared data

pliant crest
#

i didn't hear they are bad thou O.o

#

i just never needed to template data before

flint wraith
#

just a question, why would you be worried others would tamper with hp?

#

unity is not for building large MMOs

#

where that would be concern

pliant crest
#

how would using SOs prevent that?

rain flicker
#

Thanks for the discussion guys I've got to warp up

rain flicker
pliant crest
#

oh

#

so the problem is in a team of developers

flint wraith
#

wasnt that what i was saying?

pliant crest
#

you want to stop others from accidentally setting variables on this SO

rain flicker
gaunt spoke
#

I also agree that you should not worry about other developer setting the health, just write in the doc of your system smthing like don't set this value yourself thats it

pliant crest
#

no i agree

pliant crest
#

this makes sense as a worry

#

you shouldn't be allowed to access something if you aren't suppose to be able to set it

rain flicker
#

But we have an active discussion about this in our team

gentle topaz
#

I feel like accidentally changing health would be quite the obvious bug

rain flicker
#

And I just wanted to use some of the internet's collective knowledge 😄

lament salmon
#

I also never quite understood, do people in programmer teams just change random values for the sake of it? And then they have to be made inaccessible 😆

pliant crest
#

its more about not knowing you aren't allowed to

#

documentation can only be enforced if you read it

rain flicker
#

Yes, that's true

pliant crest
#

like imagine instead of a group of 5 people

#

you have a group of 100 people

#

propagating changes like these is dangerous

#

then again

gaunt spoke
#

and for SO runtime data you can use the NonSerialized attribute to ensure the value gets reset each time you press play and avoid magic values like in an actual build

pliant crest
#

i wouldn't use scriptable object

rain flicker
#

If we live the possibility someday someone might change it

pliant crest
#

why not just some data class?

rain flicker
#

You can't pass those to prefabs

gaunt spoke
#

because he wants to inject the health via the inspector I guess

rain flicker
#

yup

pliant crest
#

well okay...i was about to say

#

yes you can

#

but sure not through editor

lament salmon
#

to me its a container

flint wraith
pliant crest
#

fair that makes sense

pliant crest
#

there is no template here

flint wraith
#

i would use player class to store actual health

#

but structure of code is really dependant on project and this is just bunch of bullshit

pliant crest
#

but i can't think of how to protect from that anyway

#

the player class would be the only one that can expose anything at this point

#

and everything needs to be a backing field behind that

jolly token
rain flicker
#

O wow

jolly token
#

I should work on it more, been busy on other things

rain flicker
#

This might be usefully for us right now

#

Thanks

muted urchin
#

Hello everyone, does anyone know if is it possible to somehow see Debug.Log messages on a build? Or maybe even start the application using Windows command prompt and use Console.Write() to show messages at runtime in the console?

frail kestrel
#

AppData\LocalLow\project creator name\project name

#

It has an "output_log.txt"

pliant crest
#

could also technically just have a debug window

#

in game

muted urchin
#

Yeah, i know, but maybe is a little bit unconfortable ... is there some kind of alternative to see at runtime what is happening?

pliant crest
#

and reroute all your debug.logs to a singleton that switches between debug.log and that debug console output depending on build (or use preprocessor directives if they are allowed in unity)

muted urchin
#

That's interesting

#

As far as you know, however, is it possible to use the windows console to debug the build?

pliant crest
#

try google, i have no idea

muted urchin
#

Okok thanks 🙂

flint wraith
frail kestrel
flint wraith
#

oooh nice, i have always been using custom output hahahahhaha

#

thanks man

frail kestrel
#

No worries man 😎

undone coral
#

you can start with -logFile log.txt and tail the file path you provide

jolly token
undone coral
#

that's it

#

does that make sense?

#

you cannot make unity on windows print out to the console window, period full stop. on all other platforms, you can pass -logFile -

undone coral
# rain flicker Hey guys! I asked a question on StackOverflow and thought you might have some in...

when your colleagues have access to the source code and they are modifying it in Unity, access keywords like public and private are as good as the documentation gets for how a variable should be modified. if someone who can update your source code (i.e. a programmer colleague of yours) wants to modify a variable, they can. they can always change whatever you wrote. so i wouldn't get too hung up on it

#

That said you should not be using scriptable objects at all

muted urchin
hearty venture
#

I'm sort off getting around that particular problem by making our internal framework in to a upm package

#

I mean they can still do it, it's just harder xD

vivid shuttle
#

Anyone have an idea how to make a dropdown list of strings in unity code? Like if I have a collection of types for powers (ice, fire, rock) but I want to select them in the inspector?

jolly token
#

Otherwise you'll have to do with custom inspector/property drawer

vivid shuttle
#

Is there a specific way to be able to see it? Like code wise? I have it as a public.

#

Oh wait-

#

I think I found it...?

jolly token
vivid shuttle
#

I figured it out.

#

I was trying to make a drop down. Not sure what was supposed to go where.

#

Sorry to bother anyone if I did.

regal olive
#

Holy C > all other languages

flint wraith
#

you sure?

#

i can prove there are better languages

hushed moth
#

Hey guys, what do I miss from the onDestroy?

    public void ChangeURL(string nextURL = null) {
        OnDestroy();
        Awake();
        if (nextURL != null) {
            url = nextURL;
        } else {
            url = origURL;
        }
        Start();
 
    }
 
    private void Awake()
    {
        WebRTC.Initialize();
        Debug.Log("WebRTC: Initialize ok");
    }
 
    private void OnDestroy()
    {
        pc?.Close();
        pc?.Dispose();
        pc = null;
 
        WebRTC.Dispose();
        Debug.Log("WebRTC: Dispose ok");
    }
 
    private void Start()
inland prairie
#

Hello, any idea why Material.HasProperty(int nameID) is returning true on the Standard shader for a property it doesn't have?
Im checking as follows:

if (mat.HasProperty(SeparateCutoutTex)) {
    Debug.Log(mat.name + "of type " + mat.shader.name + " has it");
}```
Any help is appreciated
regal olive
placid jacinth
#

Is there a way to await for an already-running UniTask to finish?

E.g.:

Start my first UniTask
Don't immediately await for that UniTask to finish
If that UniTask is still running at some uncertain point in time later on, await for it to finish

sly grove
#

just save the task in a variable

fresh salmon
#

Yeah save the task itself in a variable

#
UniTask<int> whateverTask = WhateverAsync();
// .. other code
await whateverTask;
placid jacinth
#

Will try that, thank you both :)

#

I am guessing that I receive this error because the UniTask is not a UniTaskVoid and returns a Vector2?

#

oh wait

#

Ok so I don't await it at that point in the code, I await it afterwards
How would I go about accessing the return value?

jolly token
#

Just use UniTask<TReturn>

placid jacinth
#

Ah yes I think I see, like this

jolly token
#

Yes

placid jacinth
#

Thanks :)

undone coral
undone coral
placid jacinth
#

Ok, can I ask what the benefit of it being a var is?

austere jewel
#

There is no benefit. You don't need to cache the task before awaiting it though, you can just get the Vector2 on one line by awaiting

placid jacinth
#

Aha I see now, thanks for the tip guys :D

placid jacinth
#

Ok I'll throw one more out there before I go to bed - I can't seem to call the function? I must have missed something but I'm clueless as to why I'm getting a conversion error

#

huh, that's a strange solve
I will test it to see if the entire thing works, but I changed the library method from a UniTaskVoid to a UniTask and now it provides no error

jolly token
placid jacinth
#

Thanks, that makes a lot more sense

thick cipher
#

Anyone know why an API connection does not work on Android? I connected to APIs and on PC it works perfectly fine but on android I cant establish a connection. I use the UnityWebRequest stuff

#

should I just try it with native C# HTTPClient ?

jolly token
#

They both should work

#

Did you see logs from android?

thick cipher
#

not yet actually, was just hoping someone might have a quick idea. Ill check the logs when Im back from work

undone coral
#

you can also paste in the whole URL if it's not sensitive

thick cipher
#

"http://api.voicerss.org/?key={key}&hl=en-us&b64=false&src={audioText}" for TTS and https://opentdb.com/api.php?amount=10&difficulty=hard to generate questions

undone coral
#

okay

#

so i assume the first one is busted

#

do you know if the second one is busted?

thick cipher
#

it should not be as the operation to get data actually finishes

undone coral
#

you don't know if it is or it isn't yet

#

on android

thick cipher
#

Ill get back to you guys tomorrow, I need those logs lol

undone coral
#

the second one will definitely work

thick cipher
#

the only thing I read was that some people had problems with giving their app access to the internet

undone coral
#

i am trying to find a definitive answer, but try changing the URL to https in the first URL

thick cipher
#

will do, thank you. I dont give you much to work with haha. Sorry im a beginner at best ^^

#

ill tell you if it works ❤️

undone coral
#

aight

thick cipher
#

Found the error

#

really dumb stuff on my part

#

I had this line within my code: File.WriteAllText("C:/C#Test/quizText.txt", answerText);

#

both APIs work

hollow prairie
#

whenever i instantiate my prefab from my assetbundle it just appears black
its not a material issue its the shader, it says its loaded but it only appears black until i change it

#

left is the prefab i made the bundle with
right is loaded from the assetbundle

sly grove
jovial totem
#

I have an odd question. If I wanted to extend the animator to be able to change the animation curves and use other interpolation types than easing, how would I do that? They are written in C++ so I can't exactly change the code myself.

jovial totem
# sly grove

I meant for an animator and animation clips, so I can change the curves in the animation clip's interpolation type from a script, like to bounce or whatever

sly grove
jovial totem
#

In animation, there are multiple kinds of tweening/interpolation- Linear, easing, bouncing, cubic, etc etc

#

the animator only seems to let me have linear and easing

sly grove
jovial totem
sly grove
#

where on an animation clip is an interpolation type?

#

isn't that all just determined by the curves?

jovial totem
#

Exactly

#

Is there a way I can like… change the sampler, or extend the animation clip, that would allow me to do that

#

Determine how the curves look

#

Rather than just being bezier

sly grove
#

you can of course programmatically create the curve

jovial totem
#

Yeah that’s what I saw… darn.

sly grove
#

trying to figure out what you're wanting to accomplish

jovial totem
sly grove
#

What can't you do with the bezier curves

kindred tusk
#

You can edit the curves so they have hard corners

jovial totem
#

So. Say I have an animation of a character turning to the left. It has a smooth ease in and out between key frames. Now, if that character is scared, I want to set that curve from script to be more jittery, like an old Mickey Mouse cartoon. Or like exaggerate the motions

kindred tusk
#

Right click on the node and change its tangent type

kindred tusk
#

But if you want to hand author it, you can use animation layers

#

Make them additive

#

So make a jitter animation and put it on an additive layer

jovial totem
#

Nah, I want to do it procedurally.

jovial totem
sly grove
#

by setting tangents etc

jovial totem
#

How so?

#

Can I do that from script?

kindred tusk
#

But that will shake the whole model

jovial totem
#

Yeah I was thinking of using DOTween but I wasn’t sure how that would fit into the system

sly grove
#

you can set the tangents to whatever you want

jovial totem
#

The thing is I suppose I could make my own animation system (because the regular animation system is lacking in what I want it to do) because it's basically just sampling points along a curve but it also does fancy stuff like retargeting, which I'm not at all comfortable doing.

#

I could use IK rigs for retargeting (which is kind of my eventual goal) but that might be too daunting of a task

jovial totem
#

playables looks kind of promising actually

trail cloak
#

Hello there, we are currently experiencing crash on build from 2021.3.5f1c1, here is the following error message before crash:

#
The file 'none' is corrupted! Remove it and launch unity again!
[Position out of bounds!]
UnityEngine.Object:Instantiate(Object, Transform, Boolean)
UnityEngine.Object:Instantiate(T, Transform, Boolean)
Common.SceneDirector:SetWorldOverlay(GameObject, Vector2, String, Single, Boolean, Boolean)
Common.TimelineExtestion.COM_WorldOverlay_Set_Behaviour:OnBehaviourEnter()
Common.TimelineExtestion.GameTimeManager:Update()

[ line -1200368312]

Crash!!!
<///Crash Message>
#

The game runs fine inside the editor, and always crash at the exactly same spot on build

hearty venture
#

@trail cloak I think we will need some more info like code from Common.SceneDirector:SetWorldOverlay, and possibly the value of the arguments its getting

trail cloak
#

Sure

#

This api works fine under all other scenario though

#
        public void SetWorldOverlay(GameObject overlayGameObject, Vector2 worldPosition, string label, float transitionDuration, bool uiMode, bool tutorialMode)
        {
            if (!overlayCollection.TryGetValue(label, out var instance))
            {
                if (uiMode)
                {
                    instance = Instantiate(overlayGameObject, AdpUIPannelManager.GetActivePannelTransfrom());
                }
                else
                {
                    instance = Instantiate(overlayGameObject);
                }
                if (tutorialMode)
                {
                    UniversalGameManager.PlayTutorialOpenAudio();
                }
                overlayCollection.Add(label, instance);
            }

            if (!uiMode)
            {
                instance.transform.position = worldPosition;
            }

            if (instance.TryGetComponent<SpriteRenderer>(out var spriteRenderer))
            {
                PannelTransitionController.Instance.SetSpriteRendererActive(spriteRenderer, 1, transitionDuration);
            }
            if (uiMode && instance.TryGetComponent<CanvasGroup>(out var canvasGroup))
            {
                PannelTransitionController.Instance.SetActive(canvasGroup, transitionDuration);
            }
        }
#

The game crashes on Instantiate

#

This is the prefab I'm instantiating

long ivy
#

your stacktrace looks fishy to me. GameTimeManager is a MonoBehaviour, and that's the normal Unity-called Update right? You aren't doing something off the main thread or doing some kind of native interop?

trail cloak
#

That's just unity update

#

relax

#

I'm using that to ensure timeline goes exactly one cell each frame

flint sage
#

So you generate a number between 0 and the sum of all rarities (doesn't have to be % based), then if it's in the first 20 then it's rare, the next 30, it's uncommon, the last 50, it's common

#

You misunderstood

#

you literally write a loop that goes through your drop rates and adds them together until you reached the number you generated

#
int target = 67 (random)
int sum;
for (drop in droprates)
{
  sum += drop.perc;
  if (sum > target)
    return drop
}
viral edge
#

Ahh the sum is what I'm missing, makes perfect sense now. Add it up as I go through each rarity until I hit the target.

#

Thanks Navi!

mint sleet
#

cs

#
    public void MakeRequest<T>(VRCloudRequestBase vrCloudrequest, UnityEvent<VRCloudResponseBase> callback) where T : VRCloudResponseBase, new()
        {
            if (vrCloudrequest is IPost)
            {
                var request = new HTTPRequest(new Uri(baseURL + vrCloudrequest.Endpoint), methodType: HTTPMethods.Post, callback: OnPostRequestFinished);
                request.Send();
            }
        }```
#

This generic function has a "T" value. Is it possible to pass the "T" value to "OnPostRequestFinished" callback of the HTTPRequest?

tribal ridge
#

I got a simple question about the job system

#

Basically can I do the following:

#
    struct TestJob : IJobParallelFor
    {
        public NativeArray<byte> type;

        public void Execute(int index)
        {

            if (type[index] == 1)
            {
                if (type[2] == 1) // CAN I DO THIS??
                {
                    // do something 
                }
        }

    }```
#

or is that not allowed?

jolly token
mint sleet
#

But its not a reference type so, it does not make sense to me if there is a way

#

But you never know if there is a way. That is why I asked

fresh salmon
#

You can't, as HttpRequest isn't generic, nor its callback property.
You'll have to make another lambda to use the generic parameter, and make OnPostRequestFnished generic itself:

callback: (...) => OnPostRequestFinished<T>(...)
hushed moth
fresh salmon
hushed moth
fresh salmon
#

See that's some info that should have been included in the original post

#

Also I see you call OnDestroy, Awake, Start manually from ChangeURL? What?

#

These are Unity methods and are called by Unity. These shouldn't be ran manually

#

Either way open up the profiler, enable deep profiling and check out what makes the game lag

hushed moth
fresh salmon
#

Can't answer that, didn't use WebRTC

#

Their docs probably have the answer, or at least best practices

#

But if that thing is used to connect to a server then yes, I would get rid of the old instance and create a brand new one when changing the URL

mint sleet
#
{"data":null,"success":true,"message":"The password has been send to the phone number"}```
#
  var ob = JsonUtility.FromJson<T>(request.downloadHandler.text);```
#
        [Serializable] public class OTPResult : VRCloudResponseBase
        {
            public string Data { get; set; }
            public bool Success { get; set; }
            public string Message { get; set; }
        }```
#

Hello. The incoming JSON has "Data" field as null object.

#

But in my class it is string.

#

Maybe that is because this FromJson can not convert it to an object.

#

where am I missing? The generic "T" is OTPResult class in this case.

compact ingot
#

What is the problem? Seems like your json field names don’t match the c# names

mint sleet
#

the ob comes null

#

let me share ss to make it more clear. @compact ingot

flat marsh
#

Well it's null in the json?

#

What do you expect it to be?

mint sleet
#

I want to convert the string coming from the server to a unity object

#

I marked Data field in OtpResult as nullable

#

it did not work either.

flat marsh
#

But there is no string in the data field

#

It's missing the ""

sly grove
#

these are properties not fields

#

JsonUtility only serializes fields

compact ingot
sly grove
#

also there are no fields 😉

mint sleet
#

what is difference between field and property 🙂

sly grove
#

Now if you want to get cute about it you can do this:

[field:SerializeField] public string data { get; set; }``` and keep your properties.
sly grove
#

in this case you have an "auto implemented" property, so there is a magic field C# compiler creates for you that your functions are getting and setting

#

fields are actual, normal variables that actually hold information

sly grove
#

but normally you'd just do this:

        [Serializable] public class OTPResult : VRCloudResponseBase
        {
            public string Data;
            public bool Success;
            public string Message;
        }```
#

now those are fields, not properties

mint sleet
#

ohh! what a mistake.

#

@sly grove thanks mate

mint sleet
#

what do you mean wrong names ?

sly grove
#

yes they are case sensitive too I believe

mint sleet
#

oh! that sucks. I must change the backend responses for that.

sly grove
#

honestly all these little weird restrictions are why I prefer to use NewtonSoft JSON instead of JsonUtility

#

much more configurable

mint sleet
#

I've just started interpreter library for the backend.

sly grove
#

so you can keep your capitalized property names and serialize as something else with an attribute like [JsonProperty(PropertyName="data")]

mint sleet
#

nothing to lose to jump into newtonsoft then.

trail cloak
#

Hello, my Unity build crashes on MACOS on launch (Intel64), does anyone had a similar issue?

#

Unity Version is 2021.3.5f1c1

fiery horizon
#

anyone here used the new openID connect with the latest unity version? I got an error

#

WebRequestException: {"title":"PERMISSION_DENIED","detail":"validation failed","details":[],"status":401}

trail cloak
#

This is my apple vm

undone coral
#

that's what i thought

trail cloak
#

But the crashes also happend on actual apple device

#

Let me talk to the end user

undone coral
#

this particular stack isn't saying anything

trail cloak
#

True

#

It's same both on Mono and IL2CPP

undone coral
#

you can try to reproduce the crash on a development build, i forget where the standalone player symbols are

#

but i doubt that stack is going to say anything interesting

trail cloak
#

But unity editor do run on mac vm

undone coral
#

it says bad access right?

#

or

#

no

#

it's not

#

i mean

#

it's weird that you have audio calls on the main thread

#

do you use OnAudioFilterRead

trail cloak
#

No I didn't...

undone coral
#

i think that's a red herring

#

really hard to say. this might be worthy of sending a bug to unity

trail cloak
#

That's too bad if true...

#

just got the crash log from the user

#

May be I should't build the project using VM.... but it works in 2019.4 LTS

kindred tusk
#

It's a pain testing mac without an actual mac lying around

trail cloak
#

Just got one

#

Although it's ancient

kindred tusk
#

Yes, I just discovered that I can't update mine to latest OS

#

Which is a pain

trail cloak
#

Oh no

hard osprey
#

Can somebody help me with bundles and execution order? because scripts from bundles dont have correct order to execute. How i can execute scripts in bundle object by default order in project settings?

undone coral
#

this is just the stack

#

it should say something like SIG BAD ACCESS or whatever

#

is this on launch?

hard osprey
hard osprey
hard osprey
undone coral
#

are you trying to say you've authored a script that does not exist in the built player, and you're delivering it in an asset bundle?

#

you also shouldn't rely on order of execution for the most part for anything

#

even if there is a way to configure it

#

i am not sure if unity built players respect the attribute that allows you to set an order

hard osprey
undone coral
#

what is your objective?

#

like what kind of game is this and why do you need to bundle characters?

hard osprey
#

i have 1 000 000 000 characters, and i not need to store all of them in side current state of game progress

undone coral
#

good luck out there

jolly token
hard osprey
jolly token
jolly token
hard osprey
jolly token
hard osprey
#

I need help in unity3d.

Create object, drop on script -> create prefab and bundle of this prefab -> load the bundle in play -> get info about the scrip and how it is work.

undone coral
hard osprey
#

@undone coral my knowledge does not stand still like yours

#

@undone coral gloss dont worry u banned

jolly token
#

You have such a low chance to get help with that attitude, lol

hard osprey
hard osprey
trail cloak
#

I moved the project to an actual Mac PC then build & run it

#

This is the log

placid jacinth
#

Following on from my inquisitions yesterday:
Does anyone know if there is an equivalent or a way to make a while loop work with the UniTask system?
I can't mentally grasp how to combine it with the process of awaiting functions

I'm pretty sure what I'm asking for is a way to await a while loop's completion

For further context, I am trying to move an object to a position over a duration of time, if there is an alternate way I would gladly use it over a loop :)

gentle topaz
#

ever looked into DOTween? UniTask has support for it

midnight violet
placid jacinth
midnight violet
#

If you dont need a big tweening library, dont go dotween for every single movement. My personal opinion

#

If you need a lot of animation of a lot of different objects, dotween might be worth a short

midnight violet
placid jacinth
#

Well my question is simply how to go about doing it?
I haven't found any forum posts, or anything on the GitHub page, and I'm having a hard time understanding how I can await a loop as to speak

chilly nymph
placid jacinth
gentle topaz
chilly nymph
gentle topaz
#

Assuming you want it to move something over time

#

and you could just await the function call if you want to "await the while loop"

#

but you could also use async delegates, etc

placid jacinth
placid jacinth
chilly nymph
#

I just looked into the difference it doesn't look like therrs any gain.

midnight violet
#

If unity has a native way of doing it, most of the time, 3rd party packages will just clutter up your workflow

chilly nymph
#

If anything it looks like it uses tasks under the hood.

placid jacinth
#

Tasks are not native to Unity

gentle topaz
#

I would have to say that UniTask does the exact opposite of "clutter up your workflow"

placid jacinth
#

they are native to C#

gentle topaz
#

it's the least boilerplate thing I can imagine

chilly nymph
placid jacinth
midnight violet
#

So what about System.Threading.Tasks?

chilly nymph
midnight violet
#

Is that supported by unity?

chilly nymph
#

Await Task.yeild()

gentle topaz
#

Obviously, otherwise UniTask wouldn't be using it... But UniTask just enhances the Task system with all the bullet points mentioned in their github page.

chilly nymph
#

Unless someone else can explain what the gain from another Lib would be ( I am interested) after doing a quick look it's not doing much.

trail cloak
midnight violet
compact ingot
#

unitask also gives you a better sychronisation context, makes switching between main thread and thread pool very easy during the execution of a task and provides extension methods to unify all async patterns that are commonly used in unity (coroutines, events, dotween, async/await, channels) into one API

midnight violet
gentle topaz
#

I just don't get the pushback. It's fine to be skeptical, but as someone who uses it regularly, I can't see a reason not to use it. Even if you only use it in GUI, and especially with DOTween.

#

It's simply a good library

#

But yeah, subjective to the needs I suppose

chilly nymph
#

It's knowing when to use the right tool.

gentle topaz
#

I might, if it's more convenient

chilly nymph
midnight violet
#

I just jumped into the fun of ARCoreExtensions. Best way to have a full package to just do one job and give you a lot of bugs. Thats why I am not always a fan of 3rd party 😄

trail cloak
#

There is no memory spike though...

midnight violet
chilly nymph
trail cloak
#

The game runs fine inside editor, it just crashes in standalone build

chilly nymph
trail cloak
trail cloak
midnight violet
gentle topaz
#

I know what you are saying though, I just don't agree.

chilly nymph
#

But yes that's fine.

trail cloak
chilly nymph
midnight violet
trail cloak
chilly nymph
# trail cloak Previously I'm building it on my mac VM, but now I am building though a real mac...

And what device are you trying to play on, the new chip comes into play. Make sure this isn't the issue.

https://answers.unity.com/questions/1872228/does-any-unity-editor-run-native-on-m1-macs.html

trail cloak
#

Just mentioned, it's an ancient macbook

midnight violet
chilly nymph
#

There's m1 and silicone.

trail cloak
#

Not apple sillicon

midnight violet
#

Oh yeah, your debug log said intel iris

chilly nymph
#

What's the build device running?

#

You can't run a m1 build on a silicone.

#

It's different arcetecture.

trail cloak
#

Here's the log

midnight violet
trail cloak
chilly nymph
#

What's the old chip?

trail cloak
#

Intel

chilly nymph
#

Can't play m1 on Intel.

#

😄

trail cloak
#

I know

#

I am build to Intel

midnight violet
#

Oh, 2015 macbook air and only 4gb of ram. you might just run out of memory

chilly nymph
#

I'm 99% sure you cannot built the old arcetecture with the new one.

#

All iOS apps have to be updated for the store as well.

trail cloak
#

This is my build setup

midnight violet
#

It is working ,yu can build for old and new hardware with old and new. Apple is doing a great job here also running everything on everything

midnight violet
# trail cloak

Can you export the xcode project and zip and send it? I can test it

trail cloak
#

Sadly the build crashes every time, even on customers' mac

midnight violet
#

If you export xcode and throw it over, I can have a look at it @trail cloak

trail cloak
#

Let me see

trail cloak
midnight violet
trail cloak
#

Let me build with my vm

#

Wait, I can just build to intel64

midnight violet
#

Yeah, you might update your sdk, if you even can with that older machine

trail cloak
#

I can compile to il2cpp if I choose only Intel64, working on that

#

Takes forever for il2cpp compilation...

midnight violet
#

Yep, it converts to c++

#

On 4gb ram. Dont expect fast build times

sullen sleet
#

Hi all, I'm wondering if anyone here has any experience/resources with sending data from an android phone to unity via a USB cable?

midnight violet
#

You could use websocket or TCP/IP

#

@sullen sleet

sullen sleet
#

It's important that the data is sent through USB serial ports, not through anything internet related. This software will be used in real world locations that wont have internet connection

midnight violet
sullen sleet
#

Yep

midnight violet
#

Well, then you gotta put yourself together your own drivers that handle your phone correctly.

#

Cause, USB is nothing you can easily address

sly grove
pale pier
#

Most phones have a USB Tether option, you can probably use that to establish a local network where you can send data via usual sockets.
Seems much more direct, except that you'll need to instruct the user to manually activate USB tethering.

midnight violet
#

Or you can hook into serial communication like arduino does it.

#

But still you would need some software on your machine that interprets the serial calls. Arduino has its chips, your unity host machine and/or android phone needs that software wise if possible

sullen sleet
#

I'll start looking into these methods. Thanks for the step in the right direction @midnight violet @sly grove @pale pier !

trail cloak
midnight violet
#

Dang that is long 😄

trail cloak
#

yep...

midnight violet
#

If I had a MacOS VM here, i would hand it over to you to speed it up 😄 Sadly I did not manage to run macOS on VM yet

trail cloak
#

I do have a MacOS VM for building... but after upgrade to 2021 (along with a bunch of code restructure) everything it builds start crashing

midnight violet
#

I would rather investigate in a fast VM build than that. Imagine doing changes to test and going through 30+ minutes build times

trail cloak
#

I see

#

Give me a sec

#

Wait.... can I copy .app to windows machine?

midnight violet
#

But you cant run it 😄

#

Windows will just open its contents

trail cloak
#

That's for sure

trail cloak
midnight violet
#

Where, discord DM?

trail cloak
#

Oh no

#

I's 416MB

#

Google drive then

#

12minutes for upload

midnight violet
#

Yeah, unity is quite huge even with minimal setup

trail cloak
midnight violet
#

All good, I got time and fast download 😄

trail cloak
#

Sry for letting you to wait for so long

midnight violet
#

? All good. I am working on my own project besides, setting up my VM, updating steam, playing some game maybe 😄

trail cloak
midnight violet
#

It wants a code

midnight violet
trail cloak
midnight violet
trail cloak
#

And that's exactly the issue I met

#

I can build once more with Mac sillicon included

midnight violet
#

Well, with the xcode project I could have checked it, but with the app itself, nope

#

I dont get any debug logs from the build app. thats the reason

trail cloak
#

I see, let me check if there's any way to not leak the code itself

#

while giving you the xcode project

#

Debug?

midnight violet
#

It will convert it to cpp anyway. And I really do not care about your contents. Be sure, I signed enough NDAs in my life 😄

trail cloak
#

I see, which mode should I create the Xcode Project?

midnight violet
#

Go with debug, thats fine

trail cloak
#

Ok

#

Building...

#

That's fast

#

weird...

midnight violet
#

Its just building the xcode project, not the app itself

#

thats what xcode will do then

trail cloak
#

19 minutes for upload...

midnight violet
trail cloak
#

My fault.. sry for felling asleep

#

Done

midnight violet
#

Lets see what I get for output

trail cloak
#

Ty

midnight violet
#

Hm, did you remove something from the xcode project?

trail cloak
#

no, I didn't

midnight violet
#

Cause its missing a GameAssembly.dylib

#

So a full framework seems to be missing

trail cloak
#

GameAssembly.... that's the lib for user code

#

under il2cpp

#

I believe it's within the previous .app you got

midnight violet
#

Yeah there is something wrong with your project entirely 😄
error build: Command PhaseScriptExecution failed with a nonzero exit code

#

I would try another unity version and maybe an updated xcode version. Also use shift command k to clean build folder. That also helps sometimes. What happens if you open the xcode project and press run?

trail cloak
#

I never tried

#

Let me se

#

Oh no

#

I can't even install xcode on this vm

midnight violet
#

Why not? what does it say? 😄

trail cloak
#

"We cannot install Xcode on 'System', because it needs macOS v12.5 or higher version"

#

Guess I need a new vm for building

#

Maybe that explains...

#

I'm going to create an empty project, build it and see if it runs

#

If it doesn't, I probably need a newer version of MacOS

midnight violet
#

I guess so too...

#

Did you follow a tutorial for that macos vm?

trail cloak
#

I already forgot which on I followed..

#

But it's not smooth

#

After I create the project, it immediatly enters safe mode with compile errors

#

I resolved it removed 2D feature pack and visual scripting pack

#

Then I made a build and it runs normally....

#

But there are visual glitches

#

I think I need to get a new vm

#

Anyway, thanks for the help

midnight violet
undone coral
undone coral
#

did you decompile a game?

trail cloak
trail cloak
#

This is our product

#

It use to work when using Unity 2019.4 LTS

#

After upgrading to Unity 2021.3.5f1 LTS every build on mac crashes

#

*Works fine in Unity Mac Editor

west scarab
#

Anyone ever had this happen? It stops me from building, not sure what is going on:
Asset has disappeared while building player to 'globalgamemanagers.assets' - path '', instancedID '-268732' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

#

Already tried a reimport with no success

fickle inlet
#

could someone help me with this? I am looking for the closest vector between two vectors relative to another vector, check the image please

sly grove
#

Vector3.Project(c-a, b-a)

fickle inlet
maiden turtle
# fickle inlet

You're computing the magnitude twice, change line.Normalize() to line /= len

inland prairie
#

Hello, what is the way to initialize the variables of a ScriptableSingleton.
Thanks!

regal olive
#

When i send a request in my script and it returns JSON, how would I handle that?

trail cloak
regal olive
#

i found out

trail cloak
#

Oh

timber flame
#

I have implemented a 3d A*. It is OK but there are some issues.
I do not want to let the algorithm find a path like the picture below. A path passes below another path
How can I add the limitation mentioned?
The sample path has been shown by cubes

obsidian glade
timber flame
#

I can add the upper and lower voxels to close list when the current voxel is added to but it removes some search space

#

If it is your meaning

obsidian glade
#

that's true, it may be brutally inefficient but perhaps you can store the current optimal path for each node in its state and check against the entire path up to that point

#

not sure I have an exact answer that would definitely work and be optimal though, just throwing out ideas

timber flame
#

You say it should work?

    var currentNode = _openList.Dequeue();
                _openSet.Remove(currentNode.Point);

                _closeList.Add(currentNode.Point);
                _closeList.Add(currentNode.Point + Vector3Int.up);
                _closeList.Add(currentNode.Point + Vector3Int.down);
#

Maybe, my algorithm has bug because sometimes it cannot find the correct path (optimum)

#

Yes, I can store the current optimal path and check the condition but inefficient as you mentioned

obsidian glade
#

as you said doing that will stop the path from going underneath, but it also may remove the actual optimal path incorrectly

timber flame
#

Probably, I do not need it

timber flame
#

So, I can add upper and lower voxels to close list as well!

#

I don't know

obsidian glade
#

you may find the optimal route to a point, say (3, 1, 3), and then add (3, 0, 3) and (3, 2, 3) to the closed set - but it turns out the optimal path to your target actually goes through (3, 0, 3), you just happened to search (3, 1, 3) first - so I think you're right that it doesn't work in general, but it might work depending on the structure of your pathing/weights

timber flame
#

Yes, it should not work because I have tested

#

and thought maybe it is a bug

#

Really thanks
@obsidian glade

#

But it is annoying the current path should be kept and then check if the upper voxel is empty or filled :/
I want another easy solution 😦

#

Also, I found this problem in Dijkstra not A* but definitely it is not related

obsidian glade
#

I'd think you could include the path in the node structure, say, _openList.Add((nextNode, pathToThisNode), weight); , then when searching for adjacent nodes you can compare the path to this node and reject going underneath - I have a feeling this might blow up though

timber flame
#

So, the only way is this :/

obsidian glade
#

I'm sure someone out there has a better idea than this

timber flame
#

I have other two questions but related 🙂

#

Sometimes when node extension (children), they are obstacles and sometimes not.
It depends on the direction of extension and some conditions.
For example, a final node (target) should be connected to the previous one horizontally not diagonally.

#

In this situation, I return a giant weight for that child in gcost to prevent this node from extending. It is OK

#

and the last question is how I can limit the search space because the world size is large.
Therefore, it can find a path or not, it is OK.
1- Distance between source point and current node (child) and if it is greater than a threshold, add it to close list (soft condition)
2- Limit node count in open set (hard condition)

compact ingot
# timber flame and the last question is how I can limit the search space because the world size...

on large graphs you typically implement some sort of hierarchical A*... you might have a "overland/highway" graph that contains information about which regions are connected and a "local" graph that is used for finding the path from the closest exit of the overland graph to the actual target. This local graphy may even be dynamically generated if storing/loading a baked graph is not possible

marble locust
#

is it possible to check which file opened my game? I'm using custom file types to store 'projects/scenes'

#

either a path or a file name, i can't seem to figure it out

queen orchid
#

Hello does anyone know how multiple players with multiple concurrent scenes would work? I'm thinking of offloading each player to load their own scene and sort of synchronizing all the gameobjects between players of the same scene otherwise disable/delete it.
Is there any library/API that can be used apart from just disabling all previous scene stuff and loading a new scene locally and syncing it up with the network manager

jolly token
#

Performance seems alright, better than decimal or BigDouble in many cases

#

Though still wondering if there is any better algorithm/feature to calc 128 bit multiplication or division

queen orchid
gusty kernel
regal olive
#

Anyone know how to deserialize a json string and get values from it?

pale pier
fresh salmon
#

JsonUtility indeed. Create a class that "maps" the JSON string and deserialize away!

regal olive
#

I understand its JsonUtility.FromJson(string)

pale pier
arctic lake
#

My game doesn't pick up my SQLite database when it's built

#

But it does pick it up in the editor

#

How do I solve this

upbeat path
arctic lake
#

It's in my project folder

#

In the same place you see Assets, Plugins

#

Etc.

upbeat path
#

what is your target platform?

arctic lake
#

What does that mean

#

I'm still new with this

upbeat path
#

what platform are you building to?

arctic lake
#

Oh

#

Windows

#

Mb

upbeat path
#

then your database needs to be in Assets/StreamingAssets for it to be included in the build

arctic lake
#

Do I need to create another folder StreamingAssets or should it already be there

upbeat path
#

you need to create

arctic lake
#

Gotcha, thanks!

#

One last question

#

Does the database I have apply to everyone else when they download