#archived-code-general

1 messages Β· Page 121 of 1

buoyant crane
#

it serves as a default value when you ever decide to reset the component

normal dust
#

then why would i use list?

buoyant crane
potent sleet
#

cause you can modify it at runtime?

buoyant crane
#

only during edit time

#

not game time

#

lists allow you to modify the length during game time

harsh bobcat
#

This isnt a bad appraoch, I recently coded an interaction system using interfaces similarly to this

normal dust
#

gotcha ty πŸ™‚

woven matrix
#

sure

buoyant crane
#

Will the food interact differently depending on whether the player or the cat interacts with it? Will the player or the cat know that they are interacting with food specifically, and thus play a specific animation?

cold egret
woven matrix
# buoyant crane Will the food interact differently depending on whether the player or the cat in...

think I found this solution

 Vector3 targetPosition = target.position;

        // Set the x position of the target to match the WeaponAimEndPoint
        targetPosition.x = weaponAimEndPoint.position.x;

        // Calculate the direction from the aim point to the target position
        Vector3 direction = targetPosition - weaponAimEndPoint.position;

        // Apply the rotation offset to the direction
        Quaternion rotationOffset = Quaternion.Euler(0f, weaponAimEndPoint.rotation.eulerAngles.y, 0f);
        direction = rotationOffset * direction;

        // Calculate the vertical angle based on the transformed direction
        float verticalAngle = Vector3.SignedAngle(weaponAimEndPoint.forward, direction, transform.right);
latent latch
#

I think composition is the approach, otherwise you're going to end up parsing stuff like like dalphat was saying.

#

assuming you want a unique interaction depending on who interacts with what

wide terrace
buoyant crane
# cold egret 1. Yes, they respond differently 2. I'm not sure what exactly do you mean. (re: ...

There’s a certain amount of hard code associated with mine, but not exactly hard coded decision making(?), it takes inspiration from the IComparable Interface

class Cat : CommonBase
{
    void Update(){
         interaction.Interact(this);
    }
}
class Enemy : CommonBase
// same as cat

class Food : Interactable<CommonBase>, Interactable<Cat>, Interactable<Human>

public void Interact(CommonBase a) //do nothing

public void Interact(Cat theCat) // decreases food, and tell theCat to play eating animation?
ashen yoke
#

implements ?

buoyant crane
#

oops

ashen yoke
#

thought some new hip c# keyword

buoyant crane
#

java brain notlikethis

ashen yoke
#

clever btw

#

id change the Interactable<T> to InteractsWith<T>

buoyant crane
#

yeah I was still figuring it out in my head

heady iris
ashen yoke
#

im trying to map light cookie to shadow an area, and instead of eyeballing it i want to grab the lights internal render

#

any pointers would help

wide terrace
ashen yoke
#

all i see is command buffers

vagrant blade
latent latch
#

sounds pointy

cold egret
ashen yoke
#

you need base interface

cold egret
#

- I already have one

ashen yoke
#

non generic one

#

Interactor<Interactable>[] isnt generic, you specified the arg

cold egret
#

- Ah. Alright, but i'm afraid i'm not following. How would that work?

ashen yoke
#

Interactor<T>[] will work for all T

#

but you cant

#

so you need Interactor[]

cold egret
#

- If i do this, i lose any .Interact() accessibility right?

ashen yoke
#

you will have to cast

#

you can also create a non generic base method that calls the generic one casting from object to T

#

you will have to cast in any case, you can avoid having base interface by storing object[]

cold egret
#

- Well one object can implement however many interfaces with different generic types

ashen yoke
#

yep

#

you cant weasel out of this, its the way generics work, they are compile time and generate unique types, so you either have to cast at runtime or not use non generic collections

latent latch
#

Pumpkin's way seemed ideal, since you wouldn't need to know the type, you just method call, right

#

but if you were to do it like this, I'd assume you have to specify what type it is to call that functionality, yeah?

ashen yoke
#

yes

#

same issue

latent latch
#

ah ok

ashen yoke
#

you can type match, you can preconstruct generic types and use them to cast with Convert.ChangeType(input, typeof(T));

#

but in general a generic implies the types are known at compile time, in other words the intended way is to hardcode things that use generics

#

deviation from that lead to the realm casting

uneven nova
#

Hey everyone. Not sure if this is the right channel to ask this, but: how to i create a blur UI effect on Unity? I want to achieve something similar to these images for a pause menu and i want to know how to create one (i'm using Standard RP). If it's performance friendly, the better πŸ‘

cold egret
#

- Alright, no collections then. I'll report to my customer and see what they say about it. Thank you everybody for your time and effort

ashen yoke
#

"ui blur"

uneven nova
ashen yoke
#

then look for free ones

#

there is a toggle "free assets"

#

and github is generally foss

uneven nova
# ashen yoke plenty on asset store and github

I've already tried several of them, but they have either of those issues:

  • They don't work with Screen Space Camera UI
  • They don't work with Unity 2022
  • They have a massive performance cost
#

So if anyone knows a better alternative, free or not, i'd appreciate that

latent latch
#

time to shader graph

grim maple
#

background blur can be pretty performance intensive.

#

a lot of times you can cheat it by having a blurred image that you set as your background instead of actually blurring the current background

uneven nova
#

Thanks anyway πŸ‘

latent latch
#

best way to compare performance really

warm stratus
#

Hey, i have a reference to this RectTransform of the canvas, but how do i get the scale of this? it always return 1 for what i try

harsh bobcat
# wide terrace Could you elaborate on that implementation a little bit, out of curiosity?

bit of a late reply sorry.
I had three structs and two interfaces. first structs were TaskDataIn and TaskDataOut, where in has a caller and callee GO, and out has a string[] info and a bool success

First interface I called Soldier for lack of a better name. It has a public TaskDataOut DoTask(TaskDataIn data, string taskName) so that way one soldier class can do multiple things depending on the task required

Third struct is a Command which has a string name, a string task, and a list of Soldier to run the tasks on. It also has a TaskDataOut[] DoTasks that returns the TaskDataOut result of calling the task on every soldier in it's array

last interface is Commander. it has a Dictionary<string, Command> commandList.

Example of why I need this complex setup: A button panel with 4 buttons(Commander) where each button can be configured by the player to do different things (like open a player made list of doors(Soldier with open, close, and toggle tasks), or turn on a player made list of lights(Soldier with on, off, toggle commands) )

#

although its flawed in that it can only handle discreet data, I'm working on modifying it to handle something like the height of a lever change the brightness of lights without sending a discrete set brightness command

potent sleet
warm stratus
warm stratus
potent sleet
warm stratus
#

i wan t to use just UI i guess

wide terrace
upper pilot
#

How can I check in the code if a ScriptableObject variable is of specific type?
If I have SO: Enemy and I create 2 enemies: Zombie, Skeleton.
How can I tell in a script if:

EnemySO enemyData;

enemyData == Skeleton
#

Without adding enums to the SO or any kind of uniqueID if that's possible.

ashen yoke
#

if(enemyData is SkeletonData skeleton)

upper pilot
#

Skeleton is not a class

#

it's just a file name

ashen yoke
#

you want to compare the data references?

upper pilot
#

Perhaps that's a bad approach.
What I want to do is simply count how many instances of a specific SO I have.

ashen yoke
#

just compare the references

#

in editor?

upper pilot
#

In a script

ashen yoke
#

at runtime or editor time

upper pilot
#

runtime game.

ashen yoke
#

alright, you can make a dictionary of lists, or ints

upper pilot
#

I want to count how many skeletons and zombies I spawned.

#

yes

#

But what do I use to count them?

ashen yoke
#

if all skeletons share the same data reference then you use the reference

upper pilot
#

Skeletons and Zombies both are created with SO called EnemySO

ashen yoke
#

is it the same object in editor?

upper pilot
#

Each skeleton/zombie is created by:

List<EnemySO> enemyDB = new List<EnemySO>();

void Start()
{
  // loop 20 times
  SpawnEnemy(Instantiate(enemyDB[0]);
  SpawnEnemy(Instantiate(enemyDB[1]);
}
#

Above means I have 20 skeletons and 20 zombies.

ashen yoke
#

im asking is it the same object in editor

upper pilot
#

no

#

I mean

#

its the same prefab.

ashen yoke
#

so separate assets for skeleton and zombie

#

separate scriptable objects

#

sharing same type

latent latch
#

What's wrong with enum or type id?

potent sleet
#

you can drag in a skeleton SO in EnemySO slot

#

then do a ==

upper pilot
#

Yes, is there other way of doing it?
If I create 20 skeletons that share SO, wont they share reference?

ashen yoke
#

yes

#

so just compare references

upper pilot
upper pilot
latent latch
#

I throw guid's on all my SO assets

upper pilot
#

I did Instantiate();

#

Yeah I might do guid.

ashen yoke
#

i dont understand, you have a prefab, the prefab references SO, 20 skellies will reference the same object as a result

upper pilot
ashen yoke
#

why?

upper pilot
#

They are all unique

#

SO stores data like health

ashen yoke
#

defeats the purpose imo

upper pilot
#

I dont want to share it.

upper pilot
warm stratus
#

@potent sleet ah yes what i need is just the width of the canvas but when i put the anchoredPosition.x to the width/2 it is at the right edge

latent latch
#

generate one on awake ;)

upper pilot
#

ah

latent latch
#

assuming you're creating instances I guess

ashen yoke
#

you created a problem, for no reason, you are mixing immutable design time data with runtime data, losing so much good practice opportunities, for no reason

upper pilot
#

I probably use SO wrong.
But SO is basically a class that you can edit in the inspector.
Then I make copies of it.
Prefab is just for the sake of having a skeletong sprite + animation.
Prefab also gets a reference to the SO that created it.

ashen yoke
#

you dont need to make copies of it

#

let it just be data, immutable

upper pilot
#

What do I need to do then?

ashen yoke
#

reference them

upper pilot
#

Then I have to make a copy of all properties in another class right?

#

I wanted to avoid that

ashen yoke
#

i.e. when you need to know what is the skelly damage you do data.damage, from monobehavior that references said data

latent latch
#

I do SO duplication for some objects, but this is more being lazy and not wanting to couple it with an identical class

upper pilot
#

But perhaps that's how it's meant to be done.

ashen yoke
#

you dont need to copy anything

ashen yoke
#

just directly use data for read only ops

upper pilot
#

I mean...you are not wrong, I am not changing all the data, but there are cases when I do.

#

I have weaponSO which can level up so I change all properties of it on each level up.

#

If I have to make exact copy of a class so I can change the data at runtime it's just a pain.

ashen yoke
#

again, read only at runtime

upper pilot
#

Its basically as Mao said, It's me being lazy.

#

what do you mean define specific SOs for leveling up?

latent latch
#

my debuff/buff class is actually pretty sweet considering how lazy I made it (also an alternative to the serialize reference way)

ashen yoke
#

literally ItemLevelUpData : ScriptableObject that contains set of modifications to apply to weapon based on level

upper pilot
#

The level up is using regular class, but its stored in SO

ashen yoke
#

shove those in a list of possible level ups

upper pilot
#
public class Stats
{
  int strength;
  int dexterity;
  //etc
}

public class weaponSO: ScriptableObject
{
  [SerializeField] public Stats stats;

  public void OnLevelUp()
  {
    stats.strength += 1;
  }
}

This is simplified version of it.

#

I don't need SO for Stats tho right?

#

Regular C# class works fine.

ashen yoke
#

depends on your impl

upper pilot
#

impl?

ashen yoke
#

problem here is you are mixing runtime with edit time

upper pilot
#

Yeah, but why does Unity allow me to Instantiate SO if it's bad?

#

Do I really have to make copy of weaponSO as a regular class just so I can work with it at runtime and make copies?

ashen yoke
#

you can yes but then there is no clear distinction between the two, and hard question arises - why arent you using MonoBehavior

#

for its intended purposes

upper pilot
#

Monobehavior stores instance of WeaponSO as it's member.

warm stratus
#

I do that Debug.Log(GetComponent<Canvas>().scaleFactor); and it always return 1 why??

ashen yoke
#

if its stores a duplicate, you are doing the same thing twice

#

you already have a mono, that is supposed to carry runtime data

#

but on top of that you copy the SO

upper pilot
#
public class WeaponController: MonoBehavior
{
  List<WeaponSO> weapons = new List<WeaponSO>();

  public void UnlockWeapon(WeaponSO weaponData)
  {
    weapons.Add(Instantiate(weaponData));
  }
}
latent latch
upper pilot
#

Then each time I add/remove a property I have to update other class too?

ashen yoke
#

in 99% of the cases data will remain immutable

#

read only, in rare cases like stats you have to copy over you can use any number of copy mechanism

warm stratus
#

but the console says it s 1

upper pilot
#

I probably need to make stats into a dictionary with enums, but those can't be used with an inspector.
So it's hard to copy Stats class to another, unless done manually or through reflection(?)(I don't know much about that, but you can loop through class members somehow)

ashen yoke
#

you can use JsonUtility

#

for simple cases

latent latch
ashen yoke
#

serialize/deserialize thats like most cloning works

upper pilot
#

That's probably why I went an easy way that didn't require manually cloning data.

#

But, I don't mind refactoring it at some point.
It was mostly for a prototype.

upper pilot
#

So I will make a runtime class for each SO I have and use SO as readonly.

latent latch
ashen yoke
#

yes for most cases SO just carries data your game code will read

#

references it directly

#

thats how you can distinguish what the thing is, despite there being 1000 of them

upper pilot
#

So I should keep properties readonly in SO right?(Not possible for some of the things tho)
Can readonly still be written to via inspector?

warm stratus
latent latch
warm stratus
#

"bounding box"?

ashen yoke
warm stratus
upper pilot
#

Take Stats class for example

public class Stats
{
  int strength;
  int dexterity;
}

public class weaponSO: ScriptableObject
{
  [SerializeField] public Stats stats;
  [SerializeField] public readonly string weaponName;
}
ashen yoke
#

thats not what a readonly property is

#

that is readonly field and its not how it works

upper pilot
ashen yoke
#
public string WeaponName => weaponName;
[SerializeField] string weaponName;
upper pilot
#

oh

latent latch
# warm stratus "bounding box"?

Don't remember the logic off the top of my head, but you need to calculate the rect transform of the canvas area and do the math by the height and width of it all

upper pilot
#

Thanks, I will see if I can use that.

ashen yoke
#

you can also separate the serialized version of stats from runtime

#

which is what i do

#

since runtime stats are each a class, with lots of code attached to them, and serialized template is simply int/float values

upper pilot
#

Can you use 1 class Stats and have both readonly version for SO and normal version at runtime?

#

ah

#

got it

#

so I need a copy either way.

ashen yoke
#

you can do something like

upper pilot
#

With just data.

#

I was hoping to do a Dictionary as that makes it easier to add stats from multiple instances(weapon stats + upgrades stats etc)

ashen yoke
#
public class Stats
{
  int strength;
  int dexterity;

  public List<Stat> GetRuntimeCopy()
  {
      List<Stat> list = new List<Stat>();
      list.Add(new Stat(strength));
      list.Add(new Stat(dexterity));
      return list;
  }
}
upper pilot
#

But you can't serialize it to show in the inspector, perhaps I should use regular class for SO and dictionary at runtime.

#

oh

#

That makes sense too, so I can return a Dictionary from this function instead.

ashen yoke
#

yes

#

its also a very common pattern i use even have a few interfaces that automate some things

upper pilot
#

That will save me from having 20 functions that do exactly the same thing but for each stat(adding stat bonus for weapons + upgrades + other bonuses)

latent latch
upper pilot
#

I just couldnt afford to refactor it at that time, but this convinced me πŸ˜„

latent latch
#

How so?

#

I'm not using it elsewhere, also clean codeee

ashen yoke
upper pilot
#

What is the difference between

 [field: SerializeField]

and

[SerializeField]
#

ah

#

It automatically makes the backing field.

ashen yoke
#

you cant refactor public property name without using FormerlySerializedAs and so on

latent latch
#

Ah, yeah I can see that

ashen yoke
#

you cant easily transfer data from one serializer to another because the field names dont match

latent latch
#

just don't make mistakes

ashen yoke
#

it basically invites a set of problems you will pay for later

upper pilot
#

Alright, thanks for the help.
I will work on refactoring it in few days when I am done with other things.
Keeping SO readonly, and making a separate runtime class for the data as needed.

ashen yoke
#

feels good, saved you a world of problems

#

gl on the journey

latent latch
#

You can actually use formerlySerializedAs, but you need to add the extra syntax of the backing field in it all

#

within the string

#

gotta test it though cause that's actually something I do prefer working once I start populating my assets

ashen yoke
#

which in case of separate field you can keep its name forever the same, its largely irrelevant

latent latch
#

Oh, I see. Yeah, that's quite a downside if you do like to change up your variables.

half pike
#

Hey people, I get the following errors when I try to install the "Netcode for GameObjects" package, anyone know what should I do about it ? is it a problem with my connection or is it something I need to do ?

[Package Manager Window] Cannot perform upm operation: Unable to add package [com.unity.netcode.gameobjects@1.4.0]: One or more dependencies could not be added to the local file system: com.unity.burst: aborted [NotFound]. UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

[Package Manager Window] Error adding package: com.unity.netcode.gameobjects@1.4.0. UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

the first error asks for the "Burst" compiler package as a dependency, when I tried to install that separately it gave me an error as well,
I deleted the "packages-lock.json" and "manifest" files and reseted my packages to default from the "help" tab and it didnt help.

any other suggestions would be helpful.

ashen yoke
#

you have experimental packages enabled?

#

netcode one you added through pm or through manifest edit?

quartz whale
#

is there a way to disable or circumvent frustrum culling on a SpriteRenderer? google is only giving me solutions for meshes. i have a shader that's moving vertices around and the object is dissappearing when it's old position rather than new position is offscreen...

late lion
quartz whale
mild solar
#

Hey! I want to have the damage that was done to an enemy displayed as text that moves with every enemy. I have a version in TMP(TextMeshPro) that's displaying the damage but it's locked to a single point on the game canvas and not moving with the enemies like I want it to. Can this be solved with TMP or are there other UI Text solutions?

leaden ice
#

you could also put the UI version on a world space canvas

mild solar
#

where can I find the non-ui tmp?

leaden ice
mild solar
#

ohh and this will work with 2D games aswell?

leaden ice
#

yes

#

there are no such things as 2D games in Unity

#

it's just a camera trick

mild solar
#

ah alright, thanks for clearing two questions at once!

leaden ice
#

one simple option is to give the SO an enum then link it to a behavior with delegates. Random example from a tower defense game:

public delegate Target TargetChooser(Tower source, List<Target> targets);

public TargettingType {
  Nearest,
  LowestHealth
}

static Dictionary<TargettingType, TargetChooser> behaviorDict = new () {
  { TargettingType.Nearest, TargetNearest },
  { TargettingType.LowestHealth, TargetLowestHealth }
};

static Target TargetNearest(Tower source, List<Target> targets) {
  return target.Min(t => Vector3.Distance(source.position, t.position));
}

static Target TargetLowestHealth(Tower source, List<Target> targets) {
  return target.Min(t.Health);
}```
#

Then when you're actually dealing with your MonoBehaviour code you can do something like:

public class Tower : MonoBehaviour {
  MyTowerSO towerSpec;

  public void ChooseTarget(List<Target> possibleTargets) {
    TargetChooser chooser = behaviorDict[towerSpec.TargettingType];
    chooser(this, possibleTargets);
  }
}```
#

this is all.. semi - pseudocode of course

#

but the result is in the SO you just get a dropdown for the enum to choose the behavior type, and it gets linked up this way in code.

steady moat
#

What I like to do is use [SerializeReference] for those things

public class IChooser {
  public virtual void Choose(...);
}
public class Nearest {
   [SerializedFiled] private XXX xxx;

   public override void Choose(...) { ... }
}
public class LowestHealth {
   public override void Choose(...) { ... }
}

public class Tower : MonoBehaviour {
  [SerializedReference] private IChooser chooser;
}
leaden ice
#

yep

warm stratus
#

ahh i have a better way to explain what don't work, when i get the height for example of this canvas, it gives something that i have to divide by the scaleFactor, but i can't get the scale Factor

whole night
#

there is inbuilt priority queue in csharp but i do i use it ?
i cant seem to use it

dusty umbra
#

How would does one go about turning a spline into another object's x-axis so they can move along said spline?

#

Guess it doesn't have to be any axis in particular, just so long as I can reliably make it so traveling left and right along it works. X just happened to be the one I saw someone reference

half pike
soft shard
# dusty umbra How would does one go about turning a spline into another object's x-axis so the...

If your using the Splines asset package, you could use EvaluatePosition (https://docs.unity3d.com/Packages/com.unity.splines@1.0/api/UnityEngine.Splines.SplineUtility.html#UnityEngine_Splines_SplineUtility_EvaluatePosition__1___0_System_Single_) then pass in t, being a clamped float between 0 and 1, that basically determines its percentage along the spline (so 0.5f would be 50% along the spline) - the function returns a float3, so youd then have to convert that set of numbers into a new Vector3 then do whatever youd like with it, this is largely how I handle it for a game where movement is restricted to a spline, since after you convert it to a Vector3, in world position you can chose which axis of that vector you want to "restrict to the spine" to still allow things like jumping/falling

spare island
#

nvm i was using the wrong parameter

dusty umbra
# soft shard If your using the Splines asset package, you could use `EvaluatePosition` (https...

So I'm still fairly new to splines and this method of coding so please forgive me if I'm asking a lot, but I'm kind of struggling to figure out how to actually get this to work. I assume I can't be referencing my main spline via a SplineContainer, but I really don't know how it wants me to reference it or how the code in the repository is actually meant to be integrated. I think I understand how to convert a float3 to a Vector3 at the least, but the rest is giving me trouble.

#

Do you know of anything that I might possibly be able to reference for a more concrete idea of what I'm supposed to be doing?

soft shard
# dusty umbra Do you know of anything that I might possibly be able to reference for a more co...

Sadly I dont, aside from some of my code and the docs, tbf though I havnt poked at this code in a little bit - the SplineContainer should be a part of your scene though, so you should actually be able to reference it as UnityEngine.Splines.SplineContainer, you could do a FindObjectOfType if you only have 1 in the scene, or directly reference it in a serialized/public variable, for example, I have a function that looks something like this:

public class Example : Mono
{
UnityEngine.Splines.SplineContainer c;
float t;

void Start() {c = FindObjectOfType<...>();}

public void Move(float direction) //-1f for left, 1f for right, 0 to stand still
{
t += Time.deltaTime * (moveSpeed * direction);
t = Mathf.Clamp(t, 0f, 1f);
var f3 = c.EvaluatePosition(t);
transform.position = ConvertF3ToV3(f3);
}
}

From input, or AI or whatever, I could call Example.Move(-1f) to begin moving left along the spline at some defined moveSpeed

dusty umbra
# soft shard Sadly I dont, aside from some of my code and the docs, tbf though I havnt poked ...

I see. I'll try running with this then and hopefully I can get something rolling later tomorrow since I'm about to sleep. I've been trying to figure this out for a few days now and even my friends who have done coding for actual AAA game projects were losing their minds trying to help me so I greatly appreciate this! It's the closest I've been to a step in the right direction for a while. 😭

soft shard
dusty umbra
#

I will!

knotty sun
#

!collab

tawny elkBOT
limber agate
#

ok

wintry stone
#

in unity2d I have a bullet collision that spawns a particle system. The problem is that it spawns the particles in the middle of the collider because the bullet is traveling to fast. Does anyone know how to spawn the particles on the edge maybe by getting the colliders bounds and spawning it on the edge opposite of the transform.right?

lean sail
wintry stone
#

its not fast enough to be a Raycast. But it is just fast enough where it will spawn a little to deep in the collider I did try to make it the contact point but that had the same result thats why i was trying to think of a way to do it with the collider bounds

buoyant crane
wintry stone
wintry stone
#

yeah definetly im just hooking it all up right now

magic lake
#

How can I start a python script in a coroutine and wait for it to finish before proceeding?

potent sleet
magic lake
#

In C# you can start processes and run shell commands though right?

#

So I could just do that and somehow wait until it finishes

potent sleet
#

you can try ig

wide terrace
#

Sounds like possibly

yield return new WaitUntil( () => process.HasExited );
lean sail
#

I havent specifically ran python scripts in unity, but yes u can run it through c#

wide terrace
potent sleet
#

yea that one Editor only

wide terrace
#

ahhh that makes much more sense πŸ‘

magic lake
#

Here's my code:

public static IEnumerator CreateScript()
        {
            ProcessStartInfo psi = new ProcessStartInfo();
            psi.FileName = "/usr/bin/python3.10";
            psi.UseShellExecute = true;
            psi.Arguments = "/media/guiguig/usb-drive/family-guy-ai-pre-main/make_script.py";

            Process process = Process.Start(psi);
            yield return new WaitUntil(()=>process.HasExited);

            string output = process.StandardOutput.ReadToEnd();
            UnityEngine.Debug.Log(output);
        }
vague jolt
#

So i have a system to spawn stuff on a grid. But i don't want to have two things on top of each other. So i added colliders to these object. The problem is that I also made it that they keep getting spawned if you keep left click pressed. Meaning that 10 spawn before the collider can detect that. What should I do ? change aproach or reduce the speed you can place these objects ?

leaden ice
vague jolt
leaden ice
#

Either a 2d array or a dictionary

vague jolt
#

does not look too efficient, like i have many objects

#

like if

leaden ice
#

Huh

vague jolt
#

I will think about it, I am mainly a bit lazy to implement it

leaden ice
#

If your data is dense, use an array

#

If it's sparse use a Dictionary

#

They are extremely efficient

vague jolt
#

thanks for the help

warm aspen
magic lake
jovial fable
#

Anybody know how I can make a farming system for a top-down game?

dusk apex
jovial fable
leaden ice
#

The point is a collection you can address with x,y coordinates

#

How does a list satisfy that

leaden ice
dusk apex
jovial fable
dusk apex
jovial fable
jovial fable
potent sleet
#

statemachine πŸ‘

jovial fable
#

well yeah

prime sinew
#

You haven't shared why you can't use sprites?

jovial fable
prime sinew
#

Okay... I don't get it

jovial fable
dusk apex
cosmic ermine
#

anyway I can get visual studio to stop spamming (gives me this warning for every assembly) this warning, and rather hide it? (also the file definitely exists in that location)

unreal temple
#

Anyone know how to deal with NREs being fired from TMP when trying to use custom Sprite Assets?

#

I feel like I've done the normal steps, but nothing wants to render

#

Ah, unity restart fixed it

#

of course

loud wharf
#

Do child classes apply the changes by the property drawer on the parent class's fields? UnityChanThink

#

I feel like the way I worded it is crap. UnityChanLOL

mystic yoke
#

@loud wharf not entirely sure what you're asking here, but the default inspector will add any child fields under the parent class field. Property drawers are applied to fields, so if they're applied to a parent class field they will affect that field?

loud wharf
#

Yeah something like that.

mystic yoke
#

can you try again, maybe zoom out a bit lol

#

what are you trying to accomplish

loud wharf
#

I'm on phone. UnityChanLOL

#

Can't show anything.

queen sky
#

Need some help with the netcode, I wonder if that's the right channel

magic lake
#

Okay so I tried this line and it still doesn't run my script, any suggestions?

Process.Start("/usr/bin/python3.10", "/media/guiguig/usb-drive/family-guy-ai-pre-main/make_script.py");

It doesn't give me any errors, but it also doesn't start the script. I even looked in system monitor and it never starts python.

queen sky
#

thanks

mystic yoke
loud wharf
loud wharf
#

Oh.

#

Imma try when I get back from home or something.

mystic yoke
#

kay

loud wharf
#

When I was searching, I saw examples having to make property drawers for each inheritor and I only need to customise the base one so I was thinking if that's necessary.

mystic yoke
#

I believe those would be referring to if you had a field Foo and a child class Bar

#

a custompropertydrawer attribute only applies to the direct class by default

#

you can use the useForChildren attribute to make it apply to child classes tho

loud wharf
#

Got it.

mystic yoke
#

πŸ‘

barren vapor
#

for reasons that are stupid I have a button that i need to invoke via code but should never be able to be pushed by the user

#

should i just turn off the image and make it 1 x 1 pixel

analog relic
barren vapor
#

oooh cheers

lean sail
# barren vapor oooh cheers

just curious, why does this have to be a button? why not just c# events or unity events on an empty gameobject?

barren vapor
#

I was unable to figure that out

lean sail
#

you could get away with hiding the button, but eventually you'll have 100 buttons hiding around your canvas

barren vapor
#

I only need the 1 haha

mild solar
#

can I call methods of an associated script from a statemachine behaviour? do I need anything in the behavior script?

earnest gazelle
#

I would like to design data structures in a voxel based city building game. They are scriptable objects.

There are two different data structures. One of them is ElementDefinition. Elements are independent of views (voxels, prefabs, sprites, etc.). They are pure data like seed, gold, water, plant, etc.
The other is WorldObjectDefinition with two children, VoxelDefinition and ModuleDefinition.
VoxelDefinition contains 6 textures for each face, ElementDefinition with its amount and other stuff.
For example a rock voxel has 6 rock textures for each face and 10 kg stone element.
ModuleDefinition contains a prefab. All world objects rendered as prefab, inherit from ModuleDefinition like BuildingDefinition, PlantObjectDefinition, etc. These data structures can be composed of ElementDefinition with amount, As an instance, PlantObjectDefinition has PlantDefinition.
It is worth noting some objects like rock, can be as voxel or prefab.
Is it OK? Can you suggest your way to handle it?

amber cosmos
#

Hi guys, can someone tell me how to add a delay before the start of one video and if can I add in the same video player more than 1 video?

leaden ice
smoky crow
#

is there any particular reason to not use AssetDatabase.LoadAssetAtPath() during runtime?
I have a scriptable object I want other scriptable objects to be able to reference after being created at runtime, the alternative would be a singleton but that is more limiting by virtue of there only being one
Context is I want to have a dictionary of gameobjects for an in-game level editor

knotty sun
#

The AssetDatabase api is not available at runtime

latent latch
#

Use IDs

steady moat
#

Alternatively, you can force a reference to the asset you want in the scene and it will be loaded with the scene.

smoky crow
#

ok thanks for the help :)

gray mural
#

does anyone know why caretPosition of TMP_InputField is not changed immediately?

private void Update()
{
    typingField.caretPosition = caretPos;

    if (Input.GetKeyDown(KeyCode.Backspace) && caretPos != 0)
    {
        caretPos -= 1;
        typingField.caretPosition = caretPos;

        typingText[caretPos].ChangeColor(defaultColor);

        ChangeText();
    }
}
steady moat
#
private void OnFillVBO(Mesh vbo)
        {
            using (var helper = new VertexHelper())
            {
                if (!isFocused && !m_SelectionStillActive)
                {
                    helper.FillMesh(vbo);
                    return;
                }

                if (m_IsStringPositionDirty)
                {
                    stringPositionInternal = GetStringIndexFromCaretPosition(m_CaretPosition);
                    stringSelectPositionInternal = GetStringIndexFromCaretPosition(m_CaretSelectPosition);
                    m_IsStringPositionDirty = false;
                }

                if (m_IsCaretPositionDirty)
                {
                    caretPositionInternal = GetCaretPositionFromStringIndex(stringPositionInternal);
                    caretSelectPositionInternal = GetCaretPositionFromStringIndex(stringSelectPositionInternal);
                    m_IsCaretPositionDirty = false;
                }

                if (!hasSelection)
                {
                    GenerateCaret(helper, Vector2.zero);
                    SendOnEndTextSelection();
                }
                else
                {
                    GenerateHightlight(helper, Vector2.zero);
                    SendOnTextSelection();
                }

                helper.FillMesh(vbo);
            }
        }
steady moat
#

Why are you manipulating the caret for delete ?

#

It is already managed by the component.

gray mural
steady moat
#

?

gray mural
steady moat
#

Also, why are you not using 2 text instead ?

#

Render one on top of the other.

gray mural
steady moat
#

I mean exactly that.

gray mural
steady moat
#

If you gonna change things in Built-in, you MUST be able to solve things like that.

#

Instead of changing how the InputField works, make one text gray (Non InputField) and the other white (InputField)

gray mural
steady moat
#

Try to use MarkGeometryAsDirty after setting the carret.

gray mural
earnest gazelle
steady moat
#

In other words, in your situation, it seem more than adequate to use inheritance as an object of a given type is definitively a "Definition". That being said, as your code progress, you will need to complement those child definition with composition instead of increasing the number of functionnality in your "Definition".

loud wharf
amber cosmos
steady moat
#

This way, you will not need to change any code from the TMP_InputField

gray mural
steady moat
#

As you seem to want it

gray mural
#

but I need

#

I need Backspace key

#

not Delete

steady moat
#

You replacing the behaviour of delete with changing the color

gray mural
steady moat
mossy minnow
#
        Vector2Int one = new(cell.pos.x+1, cell.pos.y);
        Vector2Int two = new(cell.pos.x, cell.pos.y+1);
        Vector2Int three = new(cell.pos.x, cell.pos.y-1);
        Vector2Int four = new(cell.pos.x-1, cell.pos.y);
        search.Add(one);
        search.Add(two);
        search.Add(three);
        search.Add(four);```
there must be a less boilerplate way to do this right...
steady moat
#

I am saying that you do not need to remove the delete key, but can instead have 2 text (One that you modify while the other you do not)

steady moat
gray mural
fervent furnace
#

look like you are doing some dfs in orthogonal direction @mossy minnow

steady moat
#

You can removing only the delete ?

#

And keep the back space ?

#

And remove the possibility to change the focus to other than the last key ?

gray mural
gray mural
mossy minnow
#

im trying to search the cells that are directly u/d/l/r of the current cell, and if a specific var inside that isnt null, add to a List

steady moat
#

I named two of them.

gray mural
fervent furnace
#

int2 is similar to vector2int but burst compatible, you can check it to vector2int

steady moat
gray mural
fervent furnace
#

it should be parentY+DirXXX.y .....mistype

steady moat
#

I do not know, this is only guess from reading the code

#

It might work, or it might not work.

gray mural
steady moat
fervent furnace
#

this loop through diagonal and orthogonal direction

steady moat
#

Oh yeah, my bad, this way both diagonal that we needed

placid temple
#

hey guys, how to use a script as a return of a function? is something like the following possible?

public static class HeroDictionary
{
    private static Dictionary<string, Unit_Combat> nameToScript = new Dictionary<string, Unit_Combat>()
    {
        { "FeuerStarter", new Fire_Unit_Combat() },
        { "WasserStarter", new Shield_Unit_Combat() },
        { "PflanzenStarter", new Heal_Unit_Combat() }
    };

    public static Unit_Combat GetCombatScript(string heroName)
    {
        if (nameToScript.ContainsKey(heroName))
            return nameToScript[heroName];
        else
            return new Dummy_Unit_Combat();
    }
}

i then want to call the function

unitScript = HeroDictionary.GetCombatScript("someNameInDict");
steady moat
#
for(int i = - 1; i <= 1; i++)
  Vector2Int a = new Vector2Int(cell.pos.x + i, cell.pos.y + i)
  Vector2Int b = new Vector2Int(cell.pos.x - i, cell.pos.y + i)
narrow wolf
#

Hello, just wondering is it fine to have constraint as Component or should I do MonoBehavior if I'm only using functions from Component? What are your preferences? πŸ€”

steady moat
#

Is it something that you support

narrow wolf
#

well its MonoBehavior but my brother strongly suggested to use MonoBehavior instead of Component which I don't understand why so asking some preferences here

steady moat
narrow wolf
#

What does "support" mean here tho?

steady moat
narrow wolf
#

well.. anything that can sit on a gameobject I suppose.. though I clearly don't understand

knotty sun
amber cosmos
steady moat
mild solar
#

How can I get the screen position of an object? I'm using Vector2 player = GetComponent<Camera>().WorldToScreenPoint(transform.position); to get it but it tells me that there is no "Camera" attached to the game object, even though I have it as a child and one component that shows blue because its inside the 2d plane

steady moat
#

In more theorical term this is the application of Interface Segregation Principle.

narrow wolf
#

Ok, pretty dank. I don't understand enough

narrow wolf
#

I'm confused for no reason lol

steady moat
narrow wolf
#

Hmm

#

Won't just having MonoBehaviour or Component in my case work the same except that I don't really use anything from MonoBehavior?

steady moat
#

You should use what you truly need

#

Which is component

#

However, you can also say, that a Component alone does not make sense

#

We always use Monobehaviour

#

So, in this sense, you should use MonoBehaviour to constraint the amount of concept needed to express your class.

#

Both are valid argument

narrow wolf
#

There is one argument brother is throwing at me that a class:

public class Test : Singleton<Test>
{
    public void Display()
    {
        print("yo");
    }

    private void Start()
    {
        
    }
}

should not be able to use MonoBehavior messages like Start() as you are constrainting T as component in Singleton script and according to readability, it just tells that T is only a component and it should not have MonoBehavior functions but it does.

steady moat
knotty sun
#

because Singleton<T> inherits from Monobehaviour which is why your constraints make no sense

steady moat
#

Because you NEED the behaviour of a MonoBehaviour.

narrow wolf
#

That kinda makes Constrainting Component ever as useless tho.

steady moat
steady moat
#

If you do an extension method for a GetComponent, you should use a constraint on Component.

#
    public static bool TryGetComponentInChildren<T>(this GameObject go, out T component) where T : Component
    {
        component = go.GetComponentInChildren<T>();

        return component != null;
    }
narrow wolf
#

So what do you think about it? My brother says because we are using MonoBehavior functions in the inherited class, T should be constrained as MonoBehavior and not Component even if the Singleton class itself will not need anything in MonoBehavior

steady moat
narrow wolf
#

Even if I use Component as constraint in the Singleton class, it still works absolutely fine.

#

My brother just hates because it takes away the meaning in readability context.

leaden ice
#

they use reflection to find the methods

#

so it matters not

steady moat
#

Anyway, I already answer the question

#

Both argument are valid.

narrow wolf
#

Ok thx. My brother still want answer to one question that what do you think about in readability context

#

Like does it matter if it's constrained as Component or not.

steady moat
#

Like I said, this is a valid argument. It is more readable because there is less "Unknow" concept such as what is a component.

#

However, if you want to follow the SOLID principle, you should restraint to the smallest interface.

loud wharf
#

Aight, screw it, i goddamn hate property drawer.

latent latch
#

It's a trap, just focus on developing your game ;)

narrow wolf
#

Lol my brother still hates it in readability context while taking both inherited and singleton class into account.

#

Can't deal with it. Arguing from 2 hours.

loud wharf
#

Yep. dies

potent sleet
#

ah yes this infamous problem

potent sleet
loud wharf
#

I'll continue this tomorrow.

loud wharf
potent sleet
loud wharf
#

That sure sounds convenient.

#

Is there any way to fix this? UnityChanThink

#

Actually nvm, I'll just deal with this tomorrow.

#

Since I can't show code and stuff ATM.

thin kernel
#

Hello. I can't get any 'Input' events when I'm inside 'GUI.TextField', halp :(

potent sleet
thin kernel
#

For fun. Though it' would be nice to create UI through code, easy to transfer to another project without using any prefab.

potent sleet
#

prefabs are very easy to transfer over, you can literally copy and paste it. It's an asset

thin kernel
#

Kind of trying to use it exactly for testing purposes :D. Making a cheat console

potent sleet
#

ok and it's limited so no such thing as "input events"

thin kernel
#

But I can't even hit Enter at the end of my command, because it just eating all the input. Google didnt help

potent sleet
#

do the sensible thing and use TextMeshPro

thin kernel
#

yeah, I don't need it to handle my events, I just want it to stop eating them >:(

potent sleet
#

learn how to use a string input then idk what to tell ya

thin kernel
#

I know how to use tmp, I just wanna be a cool kid making UI from the code

#

sadge

potent sleet
#

using an outdated UI system, not sure that makes anything cool but you do you

#

I don't get what your question is about anyway you arent clear

hexed pecan
potent sleet
#

a proper console needs a scroll rect imo

thin kernel
#

I create field

input = GUI.TextField(new Rect(8, 8, Screen.width - 8, 20), input);

And when my game is focused on it, I can no longer recive any input events

print(Input.GetAxis("Submit")); // Not working :(

No such issues with tmp

thin kernel
potent sleet
#

I just see 2 diff strings

thin kernel
#

It looks like it can work with new Input system from one of the video I watched, but I can't use it on my current work project sadly.

potent sleet
#

ok ? not sure how this satement helps anything..

thin kernel
potent sleet
verbal pond
#

Does anyone have some resources i can take a look at about using root motion with netcode for game objects? I've been having problems about clients character being completely still, while the host character is seen by the clients as very jittery, almost as if its string to do the animation but going back to the default pose and i'm pretty stumped about it UnityChanThink

#

maybe this is more of a networking question UnityChanThink

heady iris
#

there shouldn't be anything particularly special about doing root motion -- that's just the animator moving based on the animation

#

I don't think I ever tried doing root motion with NGO tho

verbal pond
#

i can't really pinpoint what's giving me this problem then UnityChanThink my characters have the network animator component too

thick socket
#
public class popupShop : MonoBehaviour
{
    private VisualElement root;

    // Start is called before the first frame update
    void Start()
    {
        GetVEElements();
        HideRoot();
    }
    void GetVEElements()
    {
        root = GetComponent<UIDocument>().rootVisualElement;
    }
    private void OnCollisionEnter2D(Collision2D collision)
    {
        ShowRoot();
    }
    private void OnCollisionExit2D(Collision2D collision)
    {
        HideRoot();
    }
    void ShowRoot()
    {
        root.style.display = DisplayStyle.Flex;
        root.pickingMode = PickingMode.Position;
    }
    void HideRoot()
    {
        root.style.display = DisplayStyle.None;
        root.pickingMode = PickingMode.Ignore;
    }
}```
#

So when my player collides with the side it works OnCollisionEnter2D

#

but when i hit from bottom it doesn't work

#

(it works if I make it all triggers)

nova sage
#

hey guys, i am looking to integrate nvidia highlights / ansel / etc... into my newest game. the former plugins / sdks for that are now deprecated / legacy things though. since these features still very much exist, there must be another way to integrate them now, but after searching a long time all i could find was a 4 year old forum post vaguely discussing this and nothing else. unfortunately following their steps just led to a dead end for me.

does anyone here know the new way to integrate these functionalities nowadays? (even unmanaged code interop is fine)

static matrix
#

is there a easy way to do water in unity?

cosmic rain
#

Slap a transparent material on a plane mesh

static matrix
#

but that looks uglyyyy

#

like nice water

cosmic rain
#

you asked for "easy", not "high fidelity"

static matrix
#

is there an offical "water" component or something

#

yeah ig I did

cosmic rain
#

I think there's an experimental physics driven water in HDRP.

#

Other then that, asset store or write your own shader.

static matrix
#

ah Im not using HDRP
Ill figure it out

#

how does one write their own shader?

cosmic rain
#

Open your favorite text editor and write it like any other code.

#

Or you can use the Shader graph to make it simpler

static matrix
#

ah
Ill look into it

#

how do I open/use the shader graph

#

ah ill just read the docs nvm

#

water physics would be nice but I also think they would destroy my computer

heady iris
#

fake it 'til you make it!

static matrix
#

yeah

#

is there a way to make a mesh like
jiggle
like water might
Because water usually doesn't sit still like a cube

#

can I edit the vertices?

cursive gorge
#

why code generated voxel looking weird?

#
    void renderCube()
    {
        VoxelInfo VoxelInfo = new VoxelInfo();
        List<int> triangles = new List<int>();
        triangles.AddRange(VoxelInfo.upTriangles);
        triangles.AddRange(VoxelInfo.bottomTriangles);
        triangles.AddRange(VoxelInfo.leftTriangles);
        triangles.AddRange(VoxelInfo.rightTriangles);
        triangles.AddRange(VoxelInfo.forwardTriangles);
        triangles.AddRange(VoxelInfo.backwardTriangles);
        triangles.Reverse();
        Mesh mesh = new Mesh();
        mesh.vertices = new VoxelInfo().vertices;
        mesh.triangles = triangles.ToArray();
        meshFilter.mesh = mesh;
  }
        ```
cosmic rain
static matrix
#

woah is that a custom renderer thingy?

cursive gorge
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ChunkInfo
{

    public Vector3[] vertices = new Vector3[8] {
new Vector3(0, 0, 0),
new Vector3(1, 0, 0),
new Vector3(1, 0, 1),
new Vector3(0, 0, 1),
new Vector3(0, 1, 0),
new Vector3(1, 1, 0),
new Vector3(1, 1, 1),
new Vector3(0, 1, 1)
};
    public List<int> upTriangles = new List<int>() {
    4, 5, 6, 6, 7, 4
};

    public List<int> bottomTriangles = new List<int>() {
    0, 3, 2, 2, 1, 0
};

    public List<int> leftTriangles = new List<int>() {
    0, 4, 7, 7, 3, 0
};

    public List<int> rightTriangles = new List<int>() {
    1, 2, 6, 6, 5, 1
};

    public List<int> forwardTriangles = new List<int>() {
    0, 1, 5, 5, 4, 0
};

    public List<int> backwardTriangles = new List<int>() {
    3, 7, 6, 6, 2, 3
};


}
cursive gorge
cosmic rain
#

You should have 3 to 6 separate vertices per cube corner.

heady iris
#

Yes, you need to give each quad its own vertices.

cosmic rain
#

Ah, maybe just 3πŸ‘†

heady iris
#

it'd be 6 for the corners where 6 triangles meet

#

well, I guess you could get away with just 3

#

since the two tris that make up a face can share vertices

heady iris
cursive gorge
#

i got it thanks you save me a lot of time

#

πŸ˜„

#

i can fix this

#

making minecraft like chunks dont seem to hard

#

because i make a voxel πŸ˜„

#

how can i make different materials for triangles

cosmic rain
#

Submeshes probably.

#

But It that kind beats the purpose of using one mesh.

#

You should have one material that can render differently based on some data.

cursive gorge
#

I almost rendered the whole chunk as a single mesh

#

I guess I should submesh each chunk

cosmic rain
cursive gorge
#

how can i make basic cubic uv for this meshes?

cosmic rain
#

What is basic cubic uv? It depends on how you want it to unwrap.

cursive gorge
#

can you share a arcticle or something

cosmic rain
#

Just map it to the correct vertices

#

Woops, it should be 0,1 at the top left πŸ˜„

cursive gorge
#

i got it

analog relic
analog relic
#

But if you’re mimicking minecraft then you probably want a more atlas based approach

analog relic
#

Yes

cursive gorge
#

i can make i guess

#

but i need the some practice

#

any good c# ide for linux?

leaden ice
fervent furnace
#

i use vs code on window and there is linux version of vs code

cursive gorge
#

I need student account for this

leaden ice
#

Or money

#

Rider is not free but it's by far the best IDE for C# on Linux

#

if you don't want to spend money - VSCode for you.

cursive gorge
#

this is bad

wide terrace
cursive gorge
#

thanks

wide terrace
cursive gorge
#

This is unlimited to use?

wide terrace
#

From a very cursory googling, it sounds like there are no restrictions on it, yeah. You might have to deal with somewhat more bugs than their stable product however

cursive gorge
late lion
#

EAP builds are valid for 30 days after release. If you're lucky, a new build will be released before then, which resets the duration. But there are often gaps longer than that where they haven't released a new EAP build.

sleek bough
gusty viper
#

me as i just leave the server

#

ok

#

i understand

nocturne prairie
#

yes hello hi i have the question of all time
what's the best way to learn C++

gusty viper
#

code in it

#

look up stuff on stack overflow

#

other crap

nocturne prairie
#

i would like to code in unity for a game, but i do not know how to code in c++

warm wren
#

Unity doesn't use c++

gusty viper
#

look up how

fervent furnace
#

unity use c#...

nocturne prairie
#

what

#

man screw google

#

okay where do i learn c# then

vagrant blade
#

Can you link the google link where it said C++?

gusty viper
#

unity

vagrant blade
#

There are tutorials pinned to this channel, and you can also do the !learn series.

tawny elkBOT
#

πŸ§‘β€πŸ« Unity Learn can offer you over 750 hours of free live and on-demand learning content for all levels of experience! Make sure to check it out at https://learn.unity.com/

gusty viper
#

!learn

tawny elkBOT
#

πŸ§‘β€πŸ« Unity Learn can offer you over 750 hours of free live and on-demand learning content for all levels of experience! Make sure to check it out at https://learn.unity.com/

nocturne prairie
#

i have this, despite it being bing
i just saw unity and c++ in the same screen and went "ooo im gonna go learn that"

#

my brain is quite small, i apologise for this

gray mural
#

but you code just on C#

heady iris
#

god I love the future it's SO GOOD

gusty viper
#

im getting unity on raspberry pi

#

how much ram does unity need?

nocturne prairie
gray mural
nocturne prairie
#

thanks idbb from the official unity discord server

amber cosmos
#

can I ask what is the code for start an animation on the start of the current scene?

heady iris
#

two separate problems

#

one: run something when the scene starts

#

two: play an animation

#

for the first, you can just wait for Start to be called on something that's in the scene

river kelp
#

The unity profiler is creating a lot of noise by, from what I can see, profiling itself profiling. It makes it a bit difficult for me to see if anything is actually going on. Can I prevent this in any way?

heady iris
#

There is also UnityEngine.SceneManagement.SceneManager.sceneLoaded, an event that fires when a scene is loaded

heady iris
river kelp
#

it's creating these spikes

heady iris
#

you're profiling the editor here

#

are you trying to profile the editor?

#

or are you trying to profile the game?

river kelp
#

If I switch to play mode I get what appears to be the same spikes

heady iris
#

yes, the editor will occasionally spike

river kelp
#

just, I can no longer see that it is the profiler

heady iris
#

you can just ignore the EditorLoop portion

#

that's gonna happen

river kelp
#

So if the editor loop is 90% of my ms, that means I'm probably fine?

#

and I should focus on whatever happens in the PlayerLoop, if the percentage goes up?

heady iris
#

Turning off the "Others" category will hide it

heady iris
river kelp
#

Cool. so if normal gameplay looks like this, with "Others turned off" then I'm probably doing fine

#

right?

heady iris
#

that's running pretty fast, yes

river kelp
#

Well it's just a basic level so hopefully I would still have some headroom to work with. Thanks for the help

warm stratus
#

Hey, this code should Debug.Log the name of the sprite touched with the mouse but it don t always work... has someone an idea?

if (EventSystem.current.IsPointerOverGameObject())
            {
                PointerEventData pointerEventData = new PointerEventData(EventSystem.current);
                pointerEventData.position = Input.mousePosition;

                List<RaycastResult> raycastResults = new List<RaycastResult>();

                EventSystem.current.RaycastAll(pointerEventData, raycastResults);

                if (raycastResults.Count > 0)
                {
                    GameObject touchedObject = raycastResults[0].gameObject;
                    Debug.Log("Objet touchΓ© : " + touchedObject.name);
                }
            }
heady iris
#

in what way does not work? does it not log anything at all? does it produce an error? does it log the wrong thing?

warm stratus
river kelp
#

And, what is an acceptable amount of garbage collection allocation to do per frame?

mossy snow
#

0 allocations per frame is ideal

#

don't worry about your non-code profiling samples unless you're profiling an actual build. It's always going to be noisy and somewhat inaccurate in the editor

fervent furnace
#

dont cross post

#

search a* pathfind

unborn pier
#

ty

#

goodbye

gray mural
#

I think I am missing something.
When typingText is List, the color of the chars is not changed, but when Array - everything works perfectly

private ColorfulChar[] typingText; // works
private List<ColorfulChar> typingText; // nope
// Start()
typingField.onValidateInput += ValidateInput;
private char ValidateInput(string text, int index, char c)
{
    string binary = Convert.ToString(c, 2);

    if (binary == "1001" || binary == "1010") return '\0';

    if (c == typingText[caretPos].c)
    {
        print("YES");

        typingText[caretPos].ChangeColor(correctColor, CharCheck.Correct);
    }
    else
    {
        print("NO");

        if (typingText[caretPos].c != ' ') 
            typingText[caretPos].ChangeColor(wrongColor, CharCheck.Wrong);
    }


    // print(binary);

    ChangeText();   
    caretPos += 1;
    return '\0';
}
fervent furnace
#

is colorfulchar struct?

gray mural
fervent furnace
#

the indexer of list return the struct and you call a method on the returned struct only
the struct in list will not be changed

gray mural
#

or any other enumerable that size can be changed

fervent furnace
#

i use unsafeList and use .Ptr to deal with this problem ie (list.Ptr+index)->method (or (list.Ptr)[index].method)

#

what i know: dont use the indexer if possible

wide terrace
#

You could maybe like

var ch = typingText[caretPos];
ch.ChangeColor(correctColor, CharCheck.Correct);
typingText[caretPo] = ch;

...but admittedly that's probably not ideal. Or use a class instead of a struct

upper pilot
#
Vector2 spawnPosition = playerData.rigidBody2D.position;

float randomX = Random.Range(0f, 1f);
float randomDirX = Random.Range(0, 2) * 2 - 1;
float randomY = Random.Range(0f, 1f);
float randomDirY = Random.Range(0, 2) * 2 - 1;

spawnPosition .x += randomX * randomDirX;
spawnPosition .y += randomY * randomDirY;

I am trying to figure out how to spawn enemies around the player, but outside of the camera view.
I tried adding +3f to x/y but the effect is not what I'd expect and enemies start spawning in the corners(outside the view, but only corners)
Probably because I am removing the ability of them spawning on x 0 or y 0 by adding + 3f to the result.

In the above example enemies spawn directly next to the player between 0 to 1f distance.
That is perfect, what I want is for them to spawn further away(but in same general direction)

upper pilot
#

I am thinking of adding 2d rectangle around the camera that will act as a spawner.

latent latch
#

Sounds interesting, I create a mask around an area to spawn them in

#

rather, make an area around the player visible, but still extend the camera view past that and spawn monsters while hiding them

upper pilot
#

That sounds confusing

#

What does that achieve compared to setting up ~4 rectangles around the camera and spawn enemies at random points inside those rectangles?

#

Tbh with that said...I might just get camera viewport width/height and calculate the "rectangle" in code so I don't even need to add them in the editor.

#

Tho that still won't be perfect, it has to be more like a circle so enemies spawn all around at about the same rate.

gray mural
upper pilot
#

I dont even know what Frustrum means

#

-,-

gray mural
#

"check if GameObject is visible to the camera"

upper pilot
#

Huh apparently its "frustum" but unity calls it "frustrum"?

gray mural
#
private void IsVisibleToCamera()
{
    Plane[] frustumPlanes = GeometryUtility.CalculateFrustumPlanes(Camera.main);

    return GeometryUtility.TestPlanesAABB(frustumPlanes, objectRenderer.bounds);
}
#

smth like this

upper pilot
#

I don't know if it's worth adding more complexity to the simple problem.

#

I don't use planes

gray mural
#

"outside of the camea view"

lean sail
upper pilot
#

Right, I should mention that I want them to spawn around the player at certain distance.

#

I said outside the camera, because that's the goal, but I can just add a number that will work.(Well I can't, cuz adding a number doesn't solve it, but that's the goal :D)

upper pilot
#
You can use this function with CalculateFrustrumPlanes
gray mural
upper pilot
#

If that makes sense.

upper pilot
#

I really don't want to go into rabbit hole of planes and frustums

#

Since I never worked with those things.

#

Ignore the camera πŸ˜„

lean sail
#

its really not a rabbithole.. this is like 2 lines of code to check if something is within the camera bounds

upper pilot
#

I just said it, cuz its kinda relevant but if I can spawn enemy 500px around the player then its good as well.

gray mural
#

so you do just make while loop and wait until Vector is outside the Camera view

upper pilot
#

(instead of px its like 5f on each axis around the player in my case)

lean sail
#

you are going to make this harder on yourself if you need it not visible on spawn, a frustum isnt as scary as it seems

#

it is quite literally just a shape

upper pilot
#

But how does that let me spawn an enemy outside the bounds?
Won't it just let me detect if the enemy is within camera view so I can look for another spot?

gray mural
lean sail
#

shape like these, where the pink plane is your "near plane" meaning how close i can see
orange is far plane, aka how far u can see
the other planes are just connecting the 2 as a pyramid

#

the camera would be pointing down in this case if it used this frustum

upper pilot
lean sail
#

then use trig to solve the angle of unit circle * 5

upper pilot
#

Because if you just do -5f to 5f then they will spawn in corners only.

gray mural
upper pilot
#

That is the issue I am trying to solve πŸ˜„

#

Tbh I have an idea, since someone helped me earlier with angle to Vector conversion

upper pilot
#

I might use that probably

#
float angle = 20f;
Vector2 direction = Quaternion.AngleAxis(angle, Vector3.forward) * Vector3.right;
lean sail
upper pilot
#

The code above gives me a vector based on an angle.

#

I can just multiply it by 5f

#

I think that might work.

lean sail
#

I dont know much about quaternions unfortunately, so hopefully you know what that does

upper pilot
#

Same haha

gray mural
lean sail
#

i really would just use trig, the link IDBB sent u does the exact solution

heady iris
gray mural
#

you needed to "spawn bullets from the player" and I have suggested to you how to do it

upper pilot
#

1 line to solve 5 problems

heady iris
#

Multiplying a Quaternion with a Vector3 produces a rotated vector

#

So, if you were to run that line many times with many different values for the angle, you'd get a bunch of points on a unit circle

upper pilot
heady iris
#

Multiply those vectors by a constant will produce a larger circle.

#

The methods provided in Vector3 and Quaternion can let you avoid doing much triginometry.

#

I find it to be much more reliable.

gray mural
lean sail
#

i see, thanks for the explanation

heady iris
#

i.e. a circle

lean sail
gray mural
lean sail
#

ah

gray mural
heady iris
#

that would make more sense for 3D, btw

#

since it performs a rotation around the Y-axis

gray mural
#

I do not know the axis they should use

#

just guessing

lean sail
#

tbh i thought this was 3d from the start

upper pilot
#

Do people use Vector2 in 3D games?

gray mural
upper pilot
#

I usually specify Vector2 to be clear, but maybe I should add that it's 2D just to be clear πŸ˜„

upper pilot
gray mural
upper pilot
#

I don't have that much experience with 3D.

heady iris
upper pilot
#

I am struggling with circles and angles atm

heady iris
#

for things that are effectively 2D, like terrain

#

then I forget to convert from Vector2 to Vector3 properly -- (a,b) to (a, 0, b) -- and it breaks

latent latch
#

circles the way to go

upper pilot
#

Makes sense, still a lot to learn <_<

latent latch
#

cause then you get to do cool stuff like wave funcs with oscillations

#

I guess you could do some squiggly square spawn waves and stuff

#

circles just make more sense to me when keeping enemy spawns dynamic

upper pilot
#

yeah circle works great

#

They spawn quite nicely around the player.

latent latch
#

yeeeah

#

they dont necessarily need to be off camera too like I was saying. Could just obscure them from view till they are close enough

upper pilot
#

Maybe I am confusing camera and view, but I meant for them to appear outside of player view.

#

I thought camera and viewport are the same size(by default)

upper pilot
heady iris
#

depends on what the angle should be measured with respect to

#

if you just want to go to back to the angle you would've punched into AngleAxis, I believe Atan2 is what you want

upper pilot
#

Thanks, I will try that

#

Actually maybe I am doing it wrong lol, but I just want to rotate an object in the direction its moving.

#

I assume there is some sort of Rotate function that takes vector2 as a parameter?

heady iris
#

set transform.right to the movement vector

#

that will align the right side of the object with the vector

upper pilot
#

Like LookDirection();

heady iris
#

or maybe transform.up

upper pilot
#

This maybe

#
         float angle = Mathf.Atan2(moveDirection.y, moveDirection.x) * Mathf.Rad2Deg;
         transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
#

Found this on a forum, guess atan2 is the way πŸ˜„

#

How does that compare to the above?

#

oh it's the angle?

#

so you don't need Mathf.Rad2Deg?

#

and atan2

#

But it doesnt rotate the object right?

#

I guess it should?

wide terrace
#

(But you'd probably want transform.right or transform.up in 2D as transform.forward is the direction of the object's local z axis)

upper pilot
#

nice

#

It's for the bullet in game so I am not to worried about breaking it as long as it flies towards correct direction πŸ˜„

heady iris
tawny elkBOT
#

πŸ§‘β€πŸ« Unity Learn can offer you over 750 hours of free live and on-demand learning content for all levels of experience! Make sure to check it out at https://learn.unity.com/

austere nexus
#

Hello everyone πŸ–οΈ I want to use Unity new Input system with Netcode, is it possible ?

somber nacelle
#

yes

burnt gull
high schooner
#

Hello gentlemen, need some help with the following error

#

Why is this cast giving me an error? Very confused

somber nacelle
#

seems like the object in the array is not a GunItem object so it can't just be cast to it like that and you haven't defined any conversion operators in either of those classes

high schooner
#

Oh i wasnt aware you needed a conversion operation with casting to inherited classes

somber nacelle
#

you're downcasting which requires the object either be the type you are casting to or have a conversion operator defining how that cast works

olive crest
#

I am messing around in Unity, trying to optimize some runtime textures that are fetched from some server. I want to do the whole messing with the texture on a seperate thread so I am probably gonna need to mess with the raw data iirc. So I do need to know what format I am messing with. Does anyone know what this means? I know my IDE is able to fetch enum names, but like, it just responds with a number. Is it just saying D32_SFloat?

dapper schooner
#

Does anyone have an example of how to return the current page and the parameters url of a webgl build. I can't get the parameters but I can get the url. I have been stuck on this all day.

var GetUrl = {

    GetURLFromPage: function () {



        var returnStr = "not found";

        try{

            returnStr = (window.location != window.parent.location)

            ? window.referrer : window.location.href;

        } catch (error) {

            console.error('Error while getting Url: '+ error);

        }

       

        var bufferSize = lengthBytesUTF8(returnStr) + 1;

        var buffer = _malloc(bufferSize);

        stringToUTF8(returnStr, buffer, bufferSize);

        return buffer;

    }

};

mergeInto(LibraryManager.library, GetUrl);
unkempt sail
#

Would there be a way to approximate the volume of a room using bounding boxes?

high schooner
somber nacelle
#

it's literally nothing to do with unity. it's how C# casting works

high schooner
#

I looked it up in general and that was just one of the top videos that came up

somber nacelle
#

why are you even trying to cast an object that is not of type GunItem to the GunItem type?

high schooner
#

I am attemping to have a base item class for runtime items, which stores normal item variable such as durability, and have specialized item classes for things like guns, which need magazine capacity stored

somber nacelle
#

okay so you can store a GunItem object in the array of the item type, but you cannot just cast an item object to GunItem unless that object already is a GunItem type or you've defined a conversion operator for it

barren lava
#

i have a question:

im working on an api and i wanna do it like this:

get data
clean it
store it in a database
get the info from the data base
present it in the form of an api key
present it the key on an interactive website
and boom

but im very new to data science but im pretty good at python
can anyone tell me how would i present the data in the data base and then in the form of a key

somber nacelle
#

this doesn't sound unity related

barren lava
#

yes ik but can anyone pleasee help me?

somber nacelle
#

go ask in a discord server where the question is relevant. this server is for unity-related topics

dapper schooner
primal wind
#

I don't think that's possible unless you have access to the JavaScript on the page

oblique spoke
primal wind
#

I mean communicate with it. Maybe you could with a lib but i don't know how exactly

spare spruce
#

HI everyone, i have the next code:

TextMeshProUGUI[] texto;
void OnTriggerStay2D(Collider2D other)
    {
        Collider2D[] contacts = Physics2D.OverlapCollider(GetComponent<Collider2D>(), new ContactFilter2D(), new Collider2D[10]);

        int count = contacts.Length;
        texto[0].text = count.ToString();
    }

I get the error message saying "can't convert type 'int' in 'unityEngine.Collider2D[]'"
Why and how do I fix it?

somber nacelle
#

you should also store the results array as a field so you aren't re-creating it every single time you call the method (not that you can even use it with your current setup)

swift falcon
#

How can I change this value through code. Its an editor background value so I need an editor script
I couldnt find anything specific on google

echo bloom
latent latch
#

maybe explain a bit more why it's wrong

echo bloom
#

so all of those slots are basically the same, the ones on the left let you grab the circle and move it all over the UI, the ones on the right you can only move it within the slots square and if you go outside of it it fires onPointerUp and drops the circle again

#

the left only fires onPointerUp if you actually let go of the mouse button

oblique spoke
latent latch
#

oh that's pretty strange if they all derive from the same slot class

#

Also, there are events for dragging so you're not always checking when you click your mouse. Your method is probably fine though, just a suggestion.

echo bloom
echo bloom
#

this is the hierarchy if that helps, the drag and drop code is in UI, the slots that dont want to let go are in the scrollview

latent latch
#

Well, could be a logic problem with the dragging and raycast, perhaps?

echo bloom
#

looking at the pointereventdata and the link it might be a conflict caused by the scroll view

latent latch
#

Ah, should maybe throw some logging to see if onpointerup firing or your dragging bool is being set another way, because that's the only thing happening in your update otherwise.

echo bloom
#

yeah i have a breakpoint set on the first line of onPointerUp

nimble kernel
#

For Entities package, how do you assert that an IComponentData struct requires another IComponentData class? I can't find an attribute

quartz folio
keen pelican
#

anyone unable to rename script with F2 in VS2022? Tried and it just went through with normal enter button.

dawn geode
#

Hey everyone Im making a clicker game similar to cookie clicker and Im having a problem with my leaderboard system. Currently Im using the lootloacker api to submit my scores online but this api only allows me to upload my score as an "int". I want to upload my score either as a float or double since they have a much larger max value. Once players get far in my game they will eventually get a score over 1 billion so this is why..
does anyone know how I could upload my score online as a double?

leaden ice
#

You'll want to use whatever lootlocker offers for freeform or custom data

mystic yoke
#

+1

dawn geode
mystic yoke
#

you'll have degrading precision as scores get larger

dawn geode
#

yea maybe but this is fine actually

#

since at one point players will make more than 1 million per click

leaden ice
#

double is not going to work for a clicker game

#

Look into BreakInfinity

dawn geode
#

whats that? on google?

leaden ice
#

It's a library

#

For extremely large numbers

dawn geode
#

ohh i'l check that out thanks a lot m8

dawn geode
mystic yoke
#

doing what, creating libraries?

languid solstice
leaden ice
#

See what's going wrong

#

Also check if the code is running as expected

#

Time to start debugging

smoky pike
#

https://paste.ofcode.org/sHyTXzdL6hPfwF2XFL2KY3
I have the following code where in the start screen(containing text and dots), the user presses on the screen "tap to start" to begin the game. Once this happens, I want to instantiate all the objects with the tag of "Dot" with a 0.25 second interval. So the user starts the game, the dots and text from the main menu disappear. Then, the objects with tag "Dot" get instantiated with 1 second interval. Note that the dots on the main menu and the dots that need to be instantiated are the same.

smoky pike
#

the dots all instantiate at the same time

leaden ice
#

Coroutines can only delay themselves

#

They aren't going to do anything to delay the code that called StartCoroutine

smoky pike
#

ah so i put the foreach loop inside the coroutine

#

alright thank you that works

cursive gorge
#

It seems like it would be inconvenient to keep the chunkdata data consisting of 10m, 10m in the array :D, do I need to learn sqlite etc. to keep and store such large data

dense tusk
#

ello lads. what i've got going on is a first person game, and i have an object that is parented to the camera to act as a placeholder for where the player can pick up an object an drop it. i'm trying to make it so when i scroll the mousewheel, the position will move further away or closer to the camera, but move related to the camera. i've managed to get the object to move, but i don't know how to go about making it move relative to the camera. i have one idea that i feel like could work, but it would be very roundabout and i know there is a simpler solution, but i don't know what it is :V

if (Input.GetAxisRaw("Mouse ScrollWheel") != 0)
        {
            HoldPos.transform.position += new Vector3(0, 0, Input.GetAxisRaw("Mouse ScrollWheel"));
        }
#

HoldPos is the game object that is parented to the camera. i've programmed it so any object you pick up with have the same position as HoldPos

edit: damn, localPosition is all i needed to do

loud wharf
#

Can someone explain to me why this happens? UnityChanOops

#
    [CustomPropertyDrawer(typeof(BaseTriggerMechanics), true)]
    internal class BaseTriggersDrawer : PropertyDrawer
    {
        // Used to add some margin between the the HelpBox and the property.
        private const int margin_height = 4;

        //  Global field to store the original (base) property height.
        private float base_height = 0;

        private const float indent = 18;

        private bool is_expanded = false;

        public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
        {
            if (is_expanded)
            {
                base_height = base.GetPropertyHeight(property, label);

                base_height += EditorGUI.GetPropertyHeight(property);

                /*
                base_height = base.GetPropertyHeight(property, label);

                float field_height = margin_height + EditorGUIUtility.singleLineHeight;

                return base_height + field_height * 2;
                */


                return base_height + (margin_height + (EditorGUIUtility.singleLineHeight + margin_height) * 2);
            }
            else return base.GetPropertyHeight(property, label);
        }

        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            SerializedProperty index_name = property.FindPropertyRelative("name");

            EditorGUI.BeginChangeCheck();
            is_expanded = EditorGUI.Foldout(position, is_expanded, index_name.stringValue);
            if (EditorGUI.EndChangeCheck())
            {
                /*
                position.y += margin_height + EditorGUIUtility.singleLineHeight;
                position.x += indent;
                position.width -= indent;

                property.NextVisible(true);
                EditorGUI.PropertyField(position, property);
                */
            }
        }
    }
somber nacelle
loud wharf
#

Yeah ig.

#

I'll deal with this at evening.

sweet perch
#

where can i ask questions about unity devops?

thin aurora
swift falcon
#

What would be the right approach for loading an external file in my game? Is it even possible to load a file that is not in the resources?

oblique spoke
weary quiver
#

Heyo, I am trying to connect an Arduino Code where I extracted some float numbers out of some Flex Sensors, and I am trying to "connect" these numbers to a hand animation in unity, but i am completely lost. Does someone know some stuff about this to help me out? πŸ₯²

hidden parrot
#

I did a similar type of thing, not in unity just printing to console and serial port worked.

#

Not sure if unity or c# has a way of reading serial port, I'm pretty sure it does.

#

This looks like what you're looking for in terms of unity side of things, and for the arduino side you'd just need to write the data to the port in some way you can read again.

weary quiver
#

I am trying to use Serial Port using a c# Script, but I am getting tons of errors for some reason.

hidden parrot
#

What's the error?

#

Also, code please.

#

That'd probably help.

weary quiver
#
using System.IO.Ports;

public class HandController : MonoBehaviour
{
    public string portName = "COM3";
    public int baudRate = 9600;
    public Animator handAnimator;

    private SerialPort dataStream;

    void Start()
    {
        dataStream = new SerialPort(portName, baudRate);
        dataStream.Open();
    }

    void Update()
    {
        if (dataStream != null && dataStream.IsOpen)
        {
            string[] fingerData = dataStream.ReadLine().Split(',');

            if (fingerData.Length == 5)
            {
                float indexValue = float.Parse(fingerData[0]);
                float middleValue = float.Parse(fingerData[1]);
                float pinkyValue = float.Parse(fingerData[2]);
                float ringValue = float.Parse(fingerData[3]);
                float thumbValue = float.Parse(fingerData[4]);

                
                handAnimator.SetFloat("Index", indexValue);
                handAnimator.SetFloat("Middle", middleValue);
                handAnimator.SetFloat("Pinky", pinkyValue);
                handAnimator.SetFloat("Ring", ringValue);
                handAnimator.SetFloat("Thumb", thumbValue);
            }
        }
    }

    void OnDestroy()
    {
        if (dataStream != null && dataStream.IsOpen)
        {
            dataStream.Close();
        }
    }
}```
#

That's the C# I've used

hidden parrot
#

Cool, what's the error?

weary quiver
#

"IOException: Access is denied."

hidden parrot
#

Are you sure the port is actually open?

weary quiver
#

Wait, lemme quickly run it again and maybe make a screenshot of the error.

hidden parrot
#

Actually, might be simpler than that?

#

If you're running the arduino sketch thing and reading the serial port data

#

As far as I know, only one application can use a serial port at a time.

weary quiver
#

So I should try closing the Arduino Program?

hidden parrot
#

(Someone else can correct me on this if I'm wrong, but I believe that's correct)

#

Yeah, try it
Just make sure the sketch is uploaded to the arduino

shadow remnant
#

How do I have support multiple controllers using the Input Manager in Project Settings? I am using Unity 2020.3.48f1 for my project.

weary quiver
hidden parrot
weary quiver
#

Yeah

#

Now I also get this error : ```FormatException: Input string was not in a correct format.
System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) (at <88e4733ac7bc4ae1b496735e6b83bbd3>:0)
System.Number.ParseSingle (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) (at <88e4733ac7bc4ae1b496735e6b83bbd3>:0)
System.Single.Parse (System.String s) (at <88e4733ac7bc4ae1b496735e6b83bbd3>:0)
Hand.Update () (at Assets/Script/Hand.cs:28)

hidden parrot
#

I think you might actually be getting data

#

Are you constantly instantiating a new version of this?

weary quiver
#

But is somehow converting it wrong?

hidden parrot
#

Or is it just one instance throughout

#

If you're rapidly opening and closing the port you'll get problems

weary quiver
#

Welp the USB is always on, haven't took it out once.

hidden parrot
#

nonono

#

In the script

weary quiver
#

Oh

hidden parrot
#

Are you constantly opening a new serial port

#

and closing it

weary quiver
#

As far as I know, I do not.

hidden parrot
#

Idea