#💻┃code-beginner

1 messages · Page 793 of 1

lofty nebula
#

Yea same interface for 2 diffrent thing

naive pawn
#

online multiplayer is just.. very inherently complex, or so i've heard

lofty nebula
#

that's wut i learned in Tuesday

lofty nebula
naive pawn
#

just seems like you'd have separate gamemodes entirely for online vs local multiplayer, and you could maybe have a base class for player control that can be extended to be the specific online/local versions

lofty nebula
#

Programmers hate redoing stuff so it must be a way of avoiding that

raven perch
#

I want to make prefab hallway that is made of 3 or 4+ sections, [entrance/exit, middle section, middle section variant, entrance/exit]
Then when I create the hall prefab in code to span some gap between rooms I can tile it.
Should I just make each section a unique prefab and deal with placing it all with code, or should I look into using splines?

frail hawk
#

try to explain it better

swift crag
#

you could use splines to guide the placement of the hallways

#

or even deform the hallway meshes based on the curve of the spline

#

(this would require you to either modify the mesh or to write a pretty wacky shader)

glass summit
#

Does Stop() pause an audio source to be resumed later again or does it stop it completely?

slender nymph
#

what do the docs say?

glass summit
#

forget I asked

raven perch
# frail hawk try to explain it better

sorry kids woke up, Im spawning rooms with a generator and the connecting them with hallways, originally I just wanted one middle section that stretched like this

frail hawk
#

Fen also replied, you might want to read the message

raven perch
#

but now im thinking i should leave each piece as a separate prefab so i could introduce some more variety

#

In my case, all of the hallways will be straight as well. so I dont think I would want to use splines if i dont need curves. I just saw that tool as a suggestion.

eternal needle
#

id go with whatever you feel is quicker and an easier workflow

frail hawk
#

i´d probably use a variation of predefined prefabs and use those instead of doing it via code

rough granite
# glass summit forget I asked

Someone's grumpy, btw the answer would've been given right there if you went to docs

It starts from the start when played again

crystal shell
#

Hello! I've been trying to fix this for hours. I'm a beginner programmer and game dev and I'm currently working on a small game that is a top down pixel 32x32 game and I just started with the player movements but I have an issue. When pressing the W button, the Walk_Back animation should play but instead the Walk_Front animation plays and I have no idea why! The transitions are as they should be. (I'm showing the Idle Blend Tree and the Walk Blend Tree in the first 2 screenshots) Screenshot 4 and 5 shows my components inside the inspector when I have chosen my character. This is my code: using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
public float speed = 5f;
private Animator animator;
private Rigidbody2D rb;

private Vector2 movement;

void Start()
{
    animator = GetComponent<Animator>();
    rb = GetComponent<Rigidbody2D>();
}

void Update()
{
    // Get raw input
    movement.x = Input.GetAxisRaw("Horizontal");
    movement.y = Input.GetAxisRaw("Vertical");

    // This tells the Animator which direction we want to face
    animator.SetFloat("MoveX", movement.x);
    animator.SetFloat("MoveY", movement.y);

    // If movement input isn’t zero
    if (movement.x != 0 || movement.y != 0)
    {
        animator.SetBool("isMoving", true);
    }
    else
    {
        animator.SetBool("isMoving", false);
    }
}

void FixedUpdate()
{
    // Actually move using physics
    rb.MovePosition(rb.position + movement.normalized * speed * Time.fixedDeltaTime);
}

}

swift crag
#

when sharing code, wrap it in ``` like this:

```cs
blarg
```

#

that'll make it show up a little more nicely in Discord

swift crag
#

Or are they all wrong?

balmy vortex
#

hi is it possible at all to lower mouse DPI inside a unity window? and if so how would you go about doing it?

prime goblet
swift crag
#

not that I'm aware of: the cursor position is coming from your operating system

crystal shell
prime goblet
swift crag
#

You can preview the animations while you have the character selected in the scene

crystal shell
#

Yes, Walk_Front is as it should be and Walk_Back is also as it should be, I still do not understand why it does not work. One thing that is interesting is that I tried to change the Walk_Back to a copy of a different animation and that did not show up either so there is nothing wrong with the animation itself, it must be inside the animator or the script

crystal shell
#

It seems like the one at the top controls what animation plays

balmy vortex
#

idk I've tried everything atp and it still just literally doesn't work

#

idrk wat I'm supposed to do

grand snow
#

However if these are used in UGUI then only an event system is required

#

Once you fix this you will start receiving these pointer events in your monobehaviour
These inputs get blocked by UI by default btw.

sour palm
#

hay I was just wondering how I can hook up my cinema machine free-look cam to a raycast.

grand snow
sour palm
#

Well the goal is to have the ray cast be projected from the position of the camera. Rather than the raycast need to find something that is directly in front of the player model it can find things the player camera is looking at.

#

my original idea is that I make the camera a component of the player script but that hasn't fully panned out.

grand snow
sour palm
#

thanks.

grand snow
#

Example i stole from the unity docs

Ray ray = Camera.main.ScreenPointToRay(Mouse.current.position.ReadValue());
        if (Physics.Raycast(ray, 100))
            print("Hit something!");
#

That is using the current mouse position. You want to provide the screen center.
You can also get away with using the camera position and forward vector (from the cameras transform)

rough granite
grand snow
warm iris
#

Can someone help pls? I'm trying to find a guide for unity's new input system, I only need buttons wasd but to rotate so it has to be button type, not value, I can't find any guide on this because everyone shows moving, even unity docs are useless

grand snow
#

This is no different to the old input system and reading horizontal and vertical

warm iris
#

I only need to check if button has been pressed

grand snow
#

because A-D is the x axis and W-S is y

#

Do not fall into that trap

#

you want to avoid reading keys directly. you know if the user is pressing left/right/up/down based on the data you read

solar hill
warm iris
#

and skip the old one

warm iris
#

I read the docs, button type meets my needs

#

and all guides are for the vector value

grand snow
#

You can check the phase and use many extension methods to know if the action was activated this frame

#

You can have the action type be button but its easier when working with pairs of keys/controls to use value

golden notch
#

what kind of a hop jogging error is this?

rich adder
golden notch
#

ItemSO[] itemSOs = Resources.LoadAll<ItemSO>("ScriptableObjects");

#

all i did was inside my scriptable object add this to allow people to get the name of it without usig a function.

    {
        assetName = name;
    }```
golden notch
#

why not?

rich adder
#

because its a Unity Object not a System one so unity deals with them internally "their own way"

#

they are initialized in the C++ code

#

You can probably just do the same thing in Awake() though..it is comparable to a constructor

zenith cypress
shell sorrel
#

i would not even use awake either since if you are using a asset version of it, its not going to call when you expect it too

#

if you need some sort of standard setup and init just make a public function and call it

rich adder
#

true there is probably better alternatives to this

shell sorrel
#

also like if something needs a constructor i feel maybe it should not be SO

#

but just a regular struct or object

rich adder
#

ya could be original setup might be creeping into xyproblem territory

shell sorrel
#

especially in cases where the SO's are referecned by other things and loaded via other things, the lifecycle messages can get pretty weird timing wise

rich adder
golden notch
#

i just made a custom attribute for a readonly attribute

#

why does it not exist already? :v

#

Why? Because I want to show the "assetname" of a SO in the editor even though it's just the name but people might not know that.

#

also a useful tool for myself for later

sour fulcrum
#

unity will lay off a thousand staff before adding small features to the core unity

golden notch
#

wow

prime goblet
#

they also still havent made serialisable dictionaries, you need packages for them

rich adder
#

priorities mannn

golden notch
#

should i store inventory data in a scriptable object? Or do I need to make an external class handler?

slender nymph
#

a scriptable object is also a class. so either way you're creating a class for it.
just keep in mind that data does not persist between play sessions unless you write it to disk so you'll need to serialize the inventory data and write it to a file either way. so how you handle it (whether using an SO or plain class) is entirely up to you

boreal sonnet
#

Can anyone tell me how to solve this issue . I'm not able to solve it on my own?

#

whenever i try to move my player this error shows.. and if i don't make any any movement no error ?... its the unity sprite flight game ?

ivory bobcat
boreal sonnet
#

yes

ivory bobcat
#

ui doc or root visual element is null

boreal sonnet
#

i'm new to this but ui is not null i've assign the ui doc in inspector window

ivory bobcat
boreal sonnet
#

yeah wait

ivory bobcat
#

Can you show the game ui object?

boreal sonnet
#

as in?

#

the player or

ivory bobcat
#

Whatever you're referencing right there in the ui document field is supposed to have a root visual element that's likely null

boreal sonnet
ivory bobcat
#

Click on the game ui object and show us the inspector

boreal sonnet
ivory bobcat
#

Is ui document a class that you've created?

boreal sonnet
#

i dont think so cuz whatever the instructions it was in the tutorials /i was only following it

ivory bobcat
boreal sonnet
#

its on the unity hub >learn>sprite flight

#

I'm learing this first then i'll create something new on my own.

boreal sonnet
ivory bobcat
#

Explanation:
.rootVisualElement gives you access to the top-level container of the UI layout.
.Q<Label>("ScoreLabel") uses Unity’s query system to find the first element of type Label with the name ScoreLabel.
Make sure the name exactly matches what you set in UI Builder — spelling, capitalization, and all.

#

Prior to the line, place these logs:cs Debug.Log(uiDocument); Debug.Log(uiDocument.rootVisualElement);
Maybe your score label name is incorrectly spelled

ivory bobcat
river kettle
#

Hey guys I'm kinda new to this but I'm having severe jittering issues with my camera so I was wondering if there were any general fixes I could try the scripts are a bit convoluted so I won't share the code rn but I've tried the fixed, late and normal update combinations but nothings seeming to work please let me know if you have any ideas even if they're super obvious I could have just missed somthing

ivory bobcat
#

Interpolate should smooth out the issues

river kettle
ivory bobcat
river kettle
#

thank you for the help I'll read through it and see what I can doUnityChanCheer

solemn crypt
#

Need help understanding this

#

I keep typing keyso and it’s not

#

Working

ivory bobcat
#

Take a proper screenshot using the pc

solemn crypt
#

Ok

ivory bobcat
#

!code
Or post it properly as suggested by the bot

radiant voidBOT
solemn crypt
#

Here it is

naive pawn
#

why are you coding in notepad

solemn crypt
#

lol 😂 I can’t afford anything rn

naive pawn
#

get a proper ide, so it can tell you about issues in a easier-to-understand format

naive pawn
solemn crypt
#

Oh ok

naive pawn
#

!ide

radiant voidBOT
solemn crypt
#

But visual studio for 6 is outdated now

naive pawn
#

what, visual studio 2022?

#

it's still perfectly usable

solemn crypt
#

Ok

naive pawn
#

much better than notepad anyways

solemn crypt
#

Thanks

ivory bobcat
# solemn crypt

After you setup your ide (it's required to get help on this server) ||you're missing your closing brace for your Awake method||

solemn crypt
#

Cursed laptop 💻

#

lol 😂

naive pawn
#

that's.. not your computer's fault, but ok

solemn crypt
median hatch
#

are you trying to make a singleton?

#

honestly I'd setup the IDE first

#

this is no way of working

midnight plover
#

Whats the issue you got with the singleton pattern?

median hatch
#

they're good for static data and thats it

#

if you need dynamic data then save it to JSON or xml

#

then you just unserialize back to a class and its easy to read and write to it during runtime

#

all of that will need a save system

#

so I'd also say you need SaveManager that sends events everytime you save the game

#

other objects that are subscribed will catch that event and write to the JSON

midnight plover
#

You can also combine SOs with data stored in any stoargetype (json, database) and use serialization to save and load into the SOs.

midnight plover
#

Depends on the usage, as always. I have been using it to create a node based quest system taht you can tie together and the serialized data will then overwrite those nodes to get the players status of the quest for example

median hatch
#

hm I see so you grab the SO data and overwrite it?

#

everytime you want a new value you'll need to create it twice then

#

for me everything that is dialogue is saved in an SO since i need localization

#

then in a json i save the dialogueIndex and other stuff like which emotion to show

#

or what objective to trigger

#

then it all connects nicely

midnight plover
kindred plume
#

how in gods name does 1 stop getting class errors
its all i get from every script i make

#

like how...the class name is the same as the script name

real thunder
#

I remember my scripts once or twice not being.... refreshed in unity or something? so I had to make a minor change in a file and resave it and now it's working

#

not sure it's related

kindred plume
#

i tried everything

im just restarting completely...i had this issue with my college mobile project

hexed terrace
#

you have errors (at least one) in your console... move the console tab so it's not hidden and read the errors

queen adder
#

Hello where can I ask a question about character controllers?

#

Im having an issue with it being stuck too long when going over a ledge or an edge

hexed terrace
#

If it's to do with the code, in here

solemn crypt
queen adder
#

i dont know if thats fixable with code or with some values, but i tried playing around with character controller component values and it didnt help

solemn crypt
#

I got it from a guy on YouTube.

queen adder
#

i want the capsule to fall a bit earlier.

#

I noticed in other games the character is being pushed or applied a forward force when they get too close to the edge and they just fall on their own

#

!code

radiant voidBOT
verbal dome
#

Ah I see what you mean

#

You don't want it to hang there but drop instead

verbal dome
#

Probably would need to check if the forward direction is free too

hexed terrace
#

not the forward direction, the vector direction it's going to be pushed in .. if the character is going off backwards, forward dir won't be relevant

queen adder
#

and of course I dont know how to do all those things in code ^^

hexed terrace
#

break it down, and google
First thing would be to search "how to do a sphere cast in unity"

queen adder
#

okay so I need a sphere cast physics check to check if theres anything below, and apply a force forward or backward if theres nothing

hexed terrace
#

not forward or backward from the characters perspective.. because again, if it's side on, or at any angle inbetween.. forward/ backward won't look right

verbal dome
hexed terrace
#

You will want to get the direction of the face ledge and push in that direction

queen adder
#

Okay thank you I will try searching for answers how to do that

modern lagoon
#

Hi guys, what do you think about using github for hosting unity projects? My concerns are about the project size that could easily go past 2GBs... Do you know any free/low cost alternatives?

hexed terrace
#

the two big hosts are github and gitlab.. check the pricing on there.

I don't think there's a free hosting that is gonna give you enough for a Unity project.

#

Mid last year I bought a NAS and setup a local, self-hosted, git server.. cost ~£600 for the nas and 2x 14TB HDD's

rich adder
hexed terrace
#

if you're solo ^

rich adder
#

I have over 45+ projects on github and yet to have hit free limits, as long as you use proper gitignore and reserve huge assets (over 1-2GB) for other hosts

hexed terrace
#

If not, it is possible to host your large files on something like google drive and symlink (IIRC) them into the project.

Had a couple of friends doing that on their VR project years ago - I assume it's still possible

mystic hemlock
#

shouldn't the SerializeField Objects differ from an object to another? For some reason when I edit it for an object. all objects get updated too.

#

I have an NPC script which is attached to each npc. I use the SerializeField attributes to control each NPC behaviour from the editor

#

but when I update it for one. it updates for the others

keen dew
#

What are you updating, exactly

mystic hemlock
#

the first 2

#

action. and male

#

I have different animations for female and male characters. so the bool decides which animation to play
the action decide if the npc is idle and stay still. or is moving and then uses the patrollingLocations

keen dew
#

So you have multiple objects with the NPCBehaviour component in the scene and when you check or uncheck the male bool in one of them, the others change at the same time?

keen dew
#

Can you show a video, because that shouldn't be possible with booleans

keen dew
#

You have the inspector locked. It's showing the same object the whole time

mystic hemlock
#

oh...

#

I'm so dumb

#

thank you 🫠

red igloo
#

I am still stuck on this issue and have no idea how to fix it. I am trying to rotate the player with my mouse input which works but the sensitivity is increased a lot. I tried lowering the sensitivity but it doesn't help. I think its because the tracking target is a child of the player and it will inherit the player's rotation and apply its own on top of that maybe?? Idk at this point. Should I not use cinemachine and just use a normal camera and not make it a child of the player and make it follow the player with a script?
Script: https://paste.ofcode.org/Hmai7FcYtPhDiEEw75eLBR

elfin pike
#

Why there isnt any tutorial about cursor. How to even change sensitivity? only thing i found is to have object acting as cursor, but then how to make it click UI

hearty junco
keen dew
verbal dome
# hearty junco

-Show your !code and link the tutorial
-What components does car png have

#

!code

radiant voidBOT
verbal dome
#

And does the movement work code at all?

hearty junco
hearty junco
verbal dome
hearty junco
slender nymph
hearty junco
slender nymph
hearty junco
#

Whats a back quote?

slender nymph
#

considering you are trying to post a large block of code, that doesn't matter right now

hearty junco
#

And do i do it on discord or one of the apps?

keen dew
#

You need to post the link to the paste site. The issue wasn't that we want different kind of screenshots

slender nymph
#

notice how it says "link to a service" and not "pasted on a service then post screenshots of that web page"

hearty junco
keen dew
#

Anyway this line is not how it is in the tutorial

hearty junco
#

the tutorial

keen dew
#

You really like screenshots don't you

hearty junco
#

In this video you will learn how to create a simple but very effective 2D arcade style top down steering car controller in Unity from scratch. Download complete Unity project 👉 https://www.patreon.com/posts/top-down-car-49913192

With this tutorial series you’ll be able to make a physics based race game with lots of drifting in no time. Car...

▶ Play video
#

sorry

red igloo
slender nymph
#

no, but you're probably letting this rotate the cinemachine camera around the Y axis so it's rotating faster than the player is

#

if your camera is meant to follow the rotation of the player then don't let it pan, only let it tilt

hearty junco
#

lemme check

elfin pike
#

I need help. Im very stuck into making Virtual cursor. I only found 10 years old github code, which doesnt work and is very complex for me to understand. How people make virtual cursor in this day of age?

rich adder
elfin pike
rich adder
#

generally
virtualcursor.position = Mouse.current.position.value

#

you might need to convert it to worldspace

#

I think new input system also has a "virtual cursor" you can drive

elfin pike
#

its very easy to move it, but SystemEvents wont work with virtualcursor

rich adder
#

input system package I think has example

elfin pike
#

wait virtual cursor isnt same as fake cursor? All i need was change cursor speed

rich adder
#

I know that VirtualMouseInput has a cursor speed that you can adjust

#

if you're using your own cursor you just multiply movement * speed

elfin pike
#

i created own cursor, but then cant interact with UI

rich adder
#

you can if you use custom inputmodule

red igloo
#

is it because of the action properties of my input?

elfin pike
elfin pike
queen adder
#
if (horizontalMove != Vector3.zero) // prevents unnecessary Normalize math from running
            horizontalMove.Normalize(); // Prevents the 1.41 diagonal speed increase
        
if (playerInput.sqrMagnitude > 0.01f)
    horizontalMove.Normalize();
#

which way is the better way?

queen adder
#

My rationale is can the player input actually be zero with mouses or joysticks

#

if its 0.0001 then it wont work?

verbal dome
#

Note that sqrMagnitude of 0.01f corresponds to a magnitude of 0.1f (0.1 * 0.1)

#

Which isn't a very small number

#

Do you want the input always to be 0 or 1 length?

night raptor
queen adder
#

Yes but i still have mouse inputs and joystick inputs which read between 0 and 1

night raptor
queen adder
#
void MoveCharacter()
    {
        Vector2 playerInput = moveActionReference.action.ReadValue<Vector2>();
        
        Vector3 horizontalMove = myCamera.transform.right * playerInput.x + myCamera.transform.forward * playerInput.y;
        horizontalMove.y = 0f; // Stops player from trying to move up or down when camera is looking up and down
        if (horizontalMove != Vector3.zero) // prevents unnecessary Normalize math from running
            horizontalMove.Normalize(); // Prevents the 1.41 diagonal speed increase
        
        // if (playerInput.sqrMagnitude > 0.01f)
        //     horizontalMove.Normalize();
        
        Vector3 movement = horizontalMove * movementSpeed + Vector3.up * _verticalVelocity.y;
        myController.Move(movement * Time.deltaTime);
    }
#

am I missing something

rich adder
elfin pike
red igloo
queen adder
#
horizontalMove = Vector3.ClampMagnitude(horizontalMove, 1f);
#

The result is the same

verbal dome
#

Is it not what you want?

rich adder
queen adder
#

yes but then the if (horizontalMove != Vector3.zero) is cheaper no

rich adder
#

it wont even matter at that level

#

micro optimizations unecessary

queen adder
#

my concern is if inputs are indeed dead zero, if some joystick would have like a little input of 0.002 if its worn out then the (horizontalMove != Vector3.zero) it would always run the normalize function when it wouldnt be needed

queen adder
verbal dome
#

Unity uses a small epsilon when comparing vectors with ==


        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
        public static bool operator==(Vector3 lhs, Vector3 rhs)
        {
            // Returns false in the presence of NaN values.
            float diff_x = lhs.x - rhs.x;
            float diff_y = lhs.y - rhs.y;
            float diff_z = lhs.z - rhs.z;
            float sqrmag = diff_x * diff_x + diff_y * diff_y + diff_z * diff_z;
            return sqrmag < kEpsilon * kEpsilon;
        }
#

You can find ClampMagnitude etc. there too

elfin pike
rich adder
verbal dome
elfin pike
queen adder
verbal dome
#

Mathf.ClampMagnitude only uses Sqrt (the "expensive" part) when the magnitude is greater than the max

rich adder
# elfin pike that code you sent me is based on old input system

yeah but then I said if you're actually using the new input system you may use the virtual cursor feature it could work then , you said but for mouse it wasnt working, and I said It might need to be added in the action map with the "virtual cursor" option on

verbal dome
#

Joystick deadzones and such

queen adder
#

Im reading now that ClampMagnitude is the better way especially for analog joysticks

#

using the Normalize function wouldnt preserve the sensitivity, so the acceleration speed would go from 0 to 1 instantly even if the analog stick would be moved very slightly

#

ClampMagnitude preserves that

night raptor
#

Clamping the magnitude is often what you want to do instead of forcing it to a value. The input systems usually have also some value for each axis to define how large the input needs to be before it registers so usually you don't have to care about that in your own code (I have no clue about the new input system but would be shocked if there wasn't one)

queen adder
#

I mean there should be a registered deadzone built in the Input System for sure

night raptor
opal zodiac
#

YOO anyone able to help me understand inheritence? im trying to make a base script for flying enemies and ground enemies and its not making any sense

rocky canyon
#

imo its best to just start out simple like this example

#

where the Player class doesn't contain a hp float.. but since it inherits from Human and Human does it'll appear in the inspector as it does

#

same thing applies to methods as well

opal zodiac
#

i can understand something small like that. Once it gets more complicated where overrides are happening or protected classes start coming into play is when my brain stops working. inheriting from separate scrips also is confusing as hell for me rn

swift crag
#

you can only inherit from one base class

opal zodiac
#

im thinking i should go back to the fundamentals of classes then work my way up maybe?

rich adder
#

virtual void Fart()

red igloo
swift crag
#

virtual methods allow for child classes to do something more specific than their parent

#

importantly, they allow for this kind of behavior

#
public class Foo {
  public virtual void Hello() { Debug.Log("I am Foo"); }
}

public class Bar : Foo {
  public override void Hello() { Debug.Log("I'm actually Bar"); }
}

...

Foo holder = new Foo();
holder.Hello(); // logs "I am Foo"
holder = new Bar();
holder.Hello(); // logs "I'm actually Bar"
#

non-virtual methods don't work like this: if your variable is a Foo, you get the methods of Foo, no matter what

#

imagine a method that checks if the enemy is out of bounds and should be deleted

#

The base class's method could check if the enemy is in a room the player isn't in

#

The flying class's method could check if the enemy is more than 50 meters above the ground

#

Now flying enemies get deleted if:

  • They're in the wrong room
  • They're too high up
#
public class BaseEnemy {
  public virtual bool IsInBounds() {
    return RoomIsCorrect();
  }
}

public class FlyingEnemy : BaseEnemy {
  public override bool IsInBounds() {
    return base.IsInBounds() && height < 50;
  }
}
#

it's great for when you want to add some extra logic to an existing function

#

importantly, this works correctly:

#
BaseEnemy enemy = FindAnEnemy(); // suppose this finds a flying enemy
enemy.IsInBounds(); // this checks if the enemy is too high up!
#

you don't care exactly what kind of enemy you have

#

it Just Works (tm)

#

This is what makes inheritance interesting.

#

FlyingEnemy is a specific kind of BaseEnemy with extra features

opal zodiac
#

@swift crag BRUHH thank you this is starting to make more sense

#

my brain is on fire so ima take a break then do that unity inheritance course. after that im hoping this all clicks and i can continute developing ❤️

swift crag
#

along with inheritance, you'll want to learn about composition

#

in my game, everything is an Entity

#

each Entity has a Locomotion that determines how it moves

#

e.g. HumanoidLocomotion for things that walk around

#

or FreecamLocomotion for spectators

#

this can solve some really annoying problems that inheritance introduces

#

imagine you have flying/walking enemies, and then those enemies can shoot projectiles/use melee

#

you don't want to do something like

  • Enemy
    • FlyingEnemy
      • FlyingMeleeEnemy
      • FlyingRangedEnemy
    • WalkingEnemy
    • WalkingMeleeEnemy
    • WalkingRangedEnemy
#

it's not clear what order the inheritance should even happen in

#

and you wind up with lots of duplicate code

#

A composition-based system would give each Enemy a way to move around and a way to attack

#

of course, now you have to figure out how to make the attack module talk to the movement module

#

it can get tricky 😉

midnight tree
rocky canyon
#

Fen covered it pretty well ☝️

midnight tree
#

Yes but not clearly understandable until you try it self ;)

mystic hemlock
#

What is this?

rich adder
mystic hemlock
rich adder
mystic hemlock
#

this is not my script

#

I don't know what "TextureMaker" is

solar hill
#

might be an asset of some kind

#

wait

#

texturemaker is your script...

rich adder
#

well wherever you copied it from probably has wrong API version

mystic hemlock
#

it is not. I didn't make any

solar hill
mystic hemlock
#

I didn't copy it

#

the error appeared only when I tried building the game.

#

it is my first time seeing it

rich adder
#

because you can't build with compile errors

#

something could be Editor only and its removing namespace / classes for it

frail hawk
#

go here

mystic hemlock
solar hill
#

also you have a script, that you have no clue what it does, that you got from somewhere?

#

whats the point of the script

#

and why is it in your project then

rich adder
#

we don't know for sure if you don't provide further context

mystic hemlock
#

So I should just delete it?

solar hill
#

youre the one who added the script.....

mystic hemlock
#

I didn't.

rich adder
#

show the !code

#

for texturemaker

radiant voidBOT
rich adder
#

!code

radiant voidBOT
rich adder
#

shit

solar hill
#

smh my head

solar hill
rich adder
#

dyno used to work with commands inline this doesnt

mystic hemlock
solar hill
#

well i doubt its built in since its in your assets folder

#

did you import any packages?

rich adder
#

TextureMaker is not something build in

mystic hemlock
#

wait a minute I will re-check the files name from the package manager

rich adder
#

whatever it is you added clearly put that there

#

it doesn't just appear out of thin air

sour palm
#

hay quick question how do I set my Print() to print a layer's name?

#

for context I have a raycast and I just need to make sure its not seeing the player layer.

slender nymph
#

you don't "set" it to do anything, you pass the layer's name to the print method. you can get the layer by using one of the LayerMask methods (i'll let you look at the docs to find out which)

#

but also a raycast expects a layer mask not a single layer, these are different things

mystic hemlock
#

I will make a copy and then delete the file and see what happens

slender nymph
#

you haven't imported any samples from any packages/assets?

mystic hemlock
slender nymph
#

you do realize that the samples contain more than just scenes, right?

rich adder
#

I bet if you delete the .cs a bunch of compile errors show up

frail hawk
rich adder
#

more than likely some asset using it

mystic hemlock
mystic hemlock
slender nymph
#

no, i mean samples from packages can include code

rich adder
mystic hemlock
sour palm
mystic hemlock
#

the editor created another copy but empty this time 🤔

slender nymph
#

presumably some asset or package did that

mystic hemlock
#

So I just need to remove every script added with all the assets I imported right?. I don't use any of them in the game so I guess it should be fine

sour palm
#

thank you.

slender nymph
#

do note that you are using a layer mask here, not a layer index so that won't be correct 😉

elfin pike
worn niche
#

So I just started with the Untiy Timeline feature and I don't like that you need the create a new signal emitter every time you want to do a new action. Is there a work around or better way? because I don't like to have so many signal emitters in my project

frail hawk
#

if you check the docs you´ll see how to use it

#

also no need for the ~ if you declare the layermask via inspector

rich adder
frail hawk
#

then you can use
Debug.Log(hit.collider)

rich adder
#

oh ya but you also do need RaycastHit to check what you hit

frail hawk
#

yes that is what i said

rich adder
#

totally missed that in the screenshot of code lol

mystic hemlock
#

thank you

frail hawk
#

congratulations

#

i think people should learn to read console messages

#

they do have a purpouse

#

especially error messages with a red color

rich adder
#

yeah who knows might be something that got added during build process if the game was able to run with a compile error

frail hawk
#

just saying

rich adder
#

but also could be something in that file might've contained an editor UnityEditor namespace only extension method

opal zodiac
sour palm
#

hay I'm just doing some testing but this line

isMonster = Physics.Raycast(transform.position, Vector3.forward, playerHight * 0.5f, whatIsMonsterdetect);

just refuses to work for me
I think its the Vector3.forward but i'm not sure why Vector3.down works fine

tawdry fox
#

I'm not really sure why this is popping up but is it important to fix early on?

swift crag
#

are you actually using the Package Validation Suite?

swift crag
#

you can also use Debug.DrawRay to visualize what you're doing

#

One possible issue here is that you're using Vector3.forward

#

This always points in the world +Z direction

#

It doesn't care which way the player is facing

tawdry fox
swift crag
#

If you want the player's forward vector, use transform.forward – this is a vector pointing in the direction of the blue arrow

swift crag
#

Unity recently introduced package signing, which lets package authors add a digital signature to the package

#

(to prove who created it, and to prove that it hasn't been tampered with)

#

A lot of existing stuff will not have signatures on it

tawdry fox
#

thank ya thank ya

hallow rock
#

hello unity community. I am currentlying experiencing a AndroidManifest.xml issue. the issue relys on READ_PHONE_STATE. i am asking if anyone can help me fix the issue and locate the issue.

Issue details: The upload could not be completed because your application contains the following Android permissions that are not supported: - android.permission.READ_PHONE_STATE Please remove the following permissions and upload your application binary again.

wintry quarry
hallow rock
sour palm
#

Debug.DrawLine(camOrientation.position, camOrientation.forward, Color.blue, 999f);

#

here this is what I got

swift crag
#

DrawRay, not DrawLine

#

This would draw a line between two points

#

If you don’t see anything, though, that suggests that the code isn’t running at all

sour palm
#

Oh lol I see it now.

#

thank you

#

how do I make it longer?

swift crag
#

it takes some extra arguments

sour palm
#

I tryed this
Debug.DrawRay(camOrientation.position, forward, Color.blue, 999f);
but now its just going the wrong direction.

rich adder
sour palm
#

its this line

rich adder
rich adder
#

show

lean burrow
#

Hey everyone! I'm doing this rollerball tutorial, and for whatever reason, the ball wont move. Ive copy and pasted the code from the tutorial, I've rewrote it multiple times, idk whats wrong. Can someone take a look at it for me please?

sour palm
# rich adder show

well its gone now.
and sorry I got it working now I just needed to change the (Vector3.forward)

radiant voidBOT
rich adder
#

camOrientation.forward * length would've worked fine

hallow rock
#

<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"></uses-permission> where do i put this, on top of the manifest? bottom, or on that line?

lean burrow
rich adder
lean burrow
lean burrow
#

ok yea its empty.

rich adder
lean burrow
rich adder
lean burrow
grand snow
#

remember that z is forward in 3d space

rich adder
#

ohh right thats a rigidbody not rigidbody2d. you trying moving up/down

lean burrow
#

forward/back

rich adder
#

yeah but in code you sent you put y

#

thats up down

#

with gravity also toggled probably why it was not working right either

lean burrow
#

I appreciate the help though guys

pearl thorn
#

Hi so I cannot find anything on how to draw a circle like have a DrawCircle function with color i can only find non filled but not filled and eather there is no tutorials for it or i am just stupid could someone please help me?

grand snow
golden notch
#

is there any read only areas with System.IO stuff?

#

or can i edit things in the "dataPath" with code?

rich adder
grand snow
#

A file being writable (and readable) is down to the OS

golden notch
#

ok

grand snow
#

persistant data path is the best place for putting game/program data in a safe readable and writable folder

#

streaming assets can be used but only for desktop platforms

warm iris
#

can someone help pls, why isnt this visible here?

rich adder
warm iris
#

oh it has to be a component?

#

I mean game object

grand snow
#

No you need to add "PlayerMovement" to a game object then drag in THAT

warm iris
#

you mean this?

grand snow
#

that is a component

golden notch
#

do scriptable ojects have to be in the resources folder?

rich adder
#

you gotta put that in

opal zodiac
#

Yooo

#

i got inheritance down however im hearing composition is way better. how would yall recommend learning composition

rich adder
#

you can combine them too

warm iris
opal zodiac
warm iris
#

these are my inputs

#

and the code again

#

is there a problem with the code?

rich adder
#

every project / goal is different

grand snow
warm iris
#

oh ok

#

but still nothing happens

grand snow
#

Did you assign the function in the unity event correctly?

warm iris
#

I think so

rich adder
warm iris
grand snow
#

that is correct. as long as the action is in "Player" map it should work just fine

rich adder
# opal zodiac epic

both a piston and a person Move, doesnt mean both should be part of the same heirarchy of parent but may both have the same component that move they can be more "freeform"

opal zodiac
grand snow
warm iris
#

this is snake

#

I only need the input to rotate the snake

#

so from what I understood, button is the type I need

grand snow
#

yea and how do you plan to know the direction the user pressed?

rich adder
warm iris
#

well I will just store a variable and whatever button the player will click, that will be the direction

#

for s it will be down, for d right etc

grand snow
#

no you would have the action give a Vector2 value which you then read and use to know the direction the user wants to move

warm iris
#

oh

#

why wouldnt my way work tho?

grand snow
#

You have assigned 4 keys for 1 button action
You therefore cannot know what key was pressed

warm iris
grand snow
#

the default actions do as i state too

warm iris
#

the code still doesnt work

grand snow
#

Its common for beginners to think "i need to check if A was pressed to go left" but reading 2 dimensional input as a Vector2 makes more sense and is more useful

#

Your action maps some keys OR a joystick to a 2d input (ideally)

warm iris
#

but the code still doesnt work

grand snow
golden notch
#

in javascript there is a promise.all that waits for all of the async tasks to get done before code is triggered. Is there anything like that in C#?

rich adder
#

Task class

grand snow
golden notch
#

looked it up Task.whenall

#

unitask?

grand snow
#

Its the best Task replacement suited for unity
Awaitable (from unity) is missing many features that Task has.

golden notch
#

is it in the package maager?

rich adder
#

sadly awaitable misses that one too.. only cases I found it useful was await some unity event or convinently switching thread to main

grand snow
#

NO

#

you can add it as a package which is explained on the unitask github page

#

@golden notch

rich adder
#

ohh

grand snow
#

no one reads anything anymore 😐

golden notch
#

it' not in the package list

grand snow
#

READ THE PAGE

rich adder
#

just used to Clicking "releases" and downloading stuff

grand snow
#

anyway use that or not 🤷‍♂️

golden notch
grand snow
#

good observation

#

a third party package wont be in the unity registry list will it?

golden notch
grand snow
#

the main readme covers the main features including UniTask.WhenAll()

golden notch
#

well... i'm a bit stuck. I can get all the filepaths in a folder, but connecting that to an addressable istead of Resource.Load is tricky

#

these are scriptable objects

frigid swift
#

how can i call the sprite manager and change the color to these blocks in the array

frigid swift
#

ok better explanation, im trying to make a system that selects one of these squares at random via an array, how do i access and modify the selected block's sprite manager via that

frigid swift
#

oh wait

#

spritr renderer i mean

grand snow
golden notch
#

if i do tag them, do i have to change all the adressses to somethign shorter?

rich adder
grand snow
golden notch
#

wait it simplifies the names not the adresses. do we touch the path at all?

grand snow
#

It simplifies the addresses

#

The address does not have to match the asset name

frigid swift
#

i know how to call it i just dont know how to get the specific chosen block in the array to change color

#

the set active script was just me debugging btw lol

grand snow
#

store the sprite renderer in a variable and then modify its colour?

golden notch
#

do we change these at all? or keep them long?

grand snow
golden notch
#

oh, i thought it meant you could shorten that to get "addressables"

rich adder
frigid swift
rich adder
grand snow
# golden notch oh, i thought it meant you could shorten that to get "addressables"

lets step back. when you first make an asset addressable it usually sets the address to be the asset name
e.g. Assets/foobar => "foobar"

i can then change the address to be whatever i want such as "coolbeans123". I can use this address to load Assets/foobar still.
The menu option I told you about just automates making addresses shorter e.g. removing folders from the address.

golden notch
#

oh yeah i forgot there's a channel for them

grand snow
#
SpriteRenderer renderer = thing.GetComponent<SpriteRenderer>();
renderer.color = someColor;
golden notch
grand snow
#

well made packages/plugins actually use them

frigid swift
grand snow
#

I have no idea what that means

#

is rooms[currentRoom] not getting the desired room?

#

I cant read your mind

frigid swift
golden notch
grand snow
frigid swift
#

man im trying 💔

grand snow
# frigid swift man im trying 💔

thats okay, we all have to learn! I suggest this because its a critical concept to programming to understand getting an object reference and doing something to that (e.g. get some thing and modify a property on that)

#
SpriteRenderer[] boxes;

boxes[Random.Range(0, boxes.Length)].color = Color.red;
sour palm
#

hay I'm just having an issue with my Input GetkeyDown. Despite all the prerequisites being true its vary finicky and rarely responds.

rich adder
sour palm
rich adder
#

if its in Update it should respond fine, the only other two that can affect is the other two bools

#

all the prerequisites being true
how are you debugging this, and how about their durations etc.
Rare its something itself wrong with GetKeyDown

#

KeyDown isn't held so you need to press it and only triggers if all three are true in the same frame

sour palm
#

I have some the bools public and some text that runs. but I think at least from my debugging its the GetKeyDown.

#

I did some testing it with out the requirements and its still funky.

rich adder
sour palm
#

removed the requirements then ran it.

rich adder
#

so whats wrong with it

sour palm
#

still doesn't reliably respond well.

hearty junco
#

So i downloaded Visual Studio Community, but still can't link it with Unity, any advise?

verbal dome
#

Where do you call ledgeGrab from?
Oh nvm you said update

hearty junco
rich adder
rich adder
sour palm
hearty junco
rich adder
rich adder
sour palm
#

nope.

rich adder
#

how many

hearty junco
sour palm
#

1 - 4 sometimes 16 if I hit it more than 20 times

rich adder
#

it was part of the steps

hearty junco
sleek palm
#

@hearty junco Can you help me

hearty junco
sleek palm
#

I'm trying to do when I click D it moves the block but it's saying this

hearty junco
# sleek palm

Sorry i am in the same boat as you i amen't one of the helpers

#

I'm 2 days into using Unity lol

rich adder
radiant voidBOT
# rich adder !input
How to Set Input

To set Active Input Handling, go to:
Project Settings > Player > Active Input Handling

• Input Manager (Old): Use the original Input settings.
• Input System Package (New): Uses the new input system package.
• Both: Use both systems.

sour palm
#

ok I'm going to try and restart unity @rich adder

hearty junco
rich adder
rich adder
# hearty junco

you dont have to spam the same photo and you yet again cropped the part that shows if its installed or which size it is

sleek palm
#

Nav where do I find project settings

sour palm
hearty junco
#

merry christmas, 1 more time to add to the spam

rich adder
rich adder
#

check the fps counter stats

hallow rock
#

anyone know if this is correct to remove READ_PHONE_STATE

hallow rock
rich adder
hallow rock
#

arl

#

cheers

rich adder
#

though android permissions is still mobile 🤷‍♂️

hallow rock
#

you think i should reset my project?

hallow rock
#

to a compatiable VR.

rich adder
hallow rock
#

you

rich adder
rich adder
hallow rock
rich adder
#

where did you see you need to set those permissions

sour palm
rich adder
sour palm
hallow rock
# rich adder where did you see you need to set those permissions

this is the error, The upload could not be completed because your application contains the following Android permissions that are not supported: - android.permission.READ_PHONE_STATE Please remove the following permissions and upload your application binary again.

rich adder
hallow rock
hallow rock
rich adder
#

seems to be there but again I havent made anything for an oculus/uploaded, maybe you should check their docs for mention of this

hallow rock
#

thank you for trying tho,

hallow rock
rich adder
#

If I recall unity does it for you in project settings unless you need something specific

hallow rock
#

like more specific

#

if not ill keep looking,

rich adder
#

Maybe under Player somewhere

hallow rock
#

yeah im in player for via android

hearty junco
#

very strange, no add option on the installs, and the editor cant validate on install

rich adder
hearty junco
rich adder
hearty junco
rich adder
#

just cause hub detects them doesn't mean they were installed through hub therefore adding modules isn't option

hearty junco
hallow rock
#

and then when i finally fix it, ima gonna be like. "this only took that long to see it"

#

so yeah

hallow rock
rich adder
#

thats how you modify it proper so unity doesn't add its own permissions

#

before build

hallow rock
#

idk why

hallow rock
rich adder
#

when you export project you do external so it can be finalized in android studio

hallow rock
rich adder
#

ehh its worth it if it helps you get something done

hallow rock
hallow rock
#

anything to get this to work.

rich adder
#

thats only if you want ability to test them in virtual environments

#

doubt you need it for vr

sleek palm
#

Anyone know how to use the new Unity input system I don't know what I'm doing wrong

rich adder
rocky canyon
#

also dont grab input from fixedupdate

rich adder
#

also you should not use deltaTime on addforce

#

that 500 is very high because of deltaTime

sleek palm
#

Didn't mean to reply to that

rich adder
rocky canyon
#

addforce happens in FixedUpdate.. its a fixed timestep.. u dont need to scale or multiply it w/ any time variable

hallow rock
rich adder
hallow rock
soft delta
#

Hello, i have this issue with a UI Canvas that i created, where whenever i try to scroll, a "ghost" layer of the texts i added appears. The way i append the text is with the function HandleNewMessage()

old karma
#

small question, Unity's Sprite atlass can help against stuttering when new sprites loads up in a scene for the first time, right?

golden notch
#

I had to add the selected line and it's still disabled, what is happening here?

#

it's only doing that in the handbook UI GO, nowhere else

ivory bobcat
#

To set an object active or inactive, use Set Active

golden notch
#

my bad, why is it disabled though? the source copyslot prefab is not disabled

ivory bobcat
golden notch
#

wait why is it disabled now?

ivory bobcat
#

Reminder that enabled/disabled is a term used for components (illustrated in the inspector). Active/inactive would be the term used for Game Objects (illustrated in the hierarchy). If we're using different terminology, I'll not be able to help you due to potential misunderstandings.

golden notch
#

yeah i changed it to active now islot.gameObject.SetActive(true);

#

why do i have to do that to begin with? the prefab it copies from isn't inactive.

#

wait

#

why is it inactive i ust changed it

ivory bobcat
#

I've got no clue what you're talking about or have changed. Post your updated code, an image of the prefab, the hierarchy, inspectors and any other necessary information.

golden notch
#

prefab

#

i enabled it and clicked save and then wen back to it and it's disabled again

ivory bobcat
#

The parent is inactive...

golden notch
#

what the what? why can't i enable it?

rich adder
ivory bobcat
#

Set the slot game object active

golden notch
#

the parent is inactive and grayed out

rich adder
#

the parent is temporary to display UI element

#

its going based of the UI child in this case

golden notch
#

it won't stay active when i set it

rich adder
#

unpack the prefab, keep it active and make a new one

golden notch
#

that fixed it

#

and it's doing it again

#

and now it's affecting my other stuff

golden notch
#

it's affecting other places now

#

(still just the slot prefab)

stray fog
#

Hey question,
I have a biom generator that paints the trees with a prefab that has capsule collider. I have written a few classes to recognise the tree infront of me from the terraindata tree and allow me to chop it. When chopped it down, I remove it from the terrain data but the collider still remains. What's the actual solution? I'm debating about doing a proximity check and whatever tree is in x radius, convert it to game object but I worry about performance and there must be a better solution no? Or track where the trees are and create empty game objects with colliders on their position and delete them as I go idk

golden notch
#

ok completly made a new file, keeping the old one

potent garnet
#

Can someone help me with a program? I'm trying to create a script that rotates the player towards your mouse position.

I've created multiple renditions so far and this is my current one:

#

This is in a 3D space but the camera simulates a 2D space (top town orthographic)

golden notch
#

ok so i figured out the issue, i was disabling the copyslot at the beginning of my code to remove the duplicate slot that i left there, and it suddenly started deleting it for ALL slots.

rancid marlin
#

hi all, i need some help understanding a hierarchical state machine.

  1. at any one point, there is only one active leaf right?
  2. does that mean that all states in the path from the root to that active leaf run its state logic? or only the leaf runs its state logic?
  3. what is the flow of checking for transitions? on every tick, does the checking order go from root -> child of active path -> down to active leaf? or from the active leaf -> up to the root?
teal viper
#

For example, you might want to keep the leaf state active regardless of the conditions of their parents, so you wouldn't check from the root.

sinful zinc
#

if i am making a leaderboard
is it better to enable it on tab down, disable on tab up or
enable when tab is pressed down, then else statement that disables

#

or doesnt matter

naive pawn
#

try both, see which feels better to use

sinful zinc
#

right

#

i mean

        {
            scoreboardUI.SetActive(true);
        }
        if (Input.GetKeyUp(KeyCode.Tab))
        {
            scoreboardUI.SetActive(false);
        }```
#

or

#
{
  scoreboardUI.SetActive(true);
}
else{..disable}```
naive pawn
#

i thought you were talking about toggle vs hold

#

do the former so you don't constantly activate/deactivate it

hallow rock
naive pawn
#

why would you need android studio for doing stuff in unity

soft delta
smoky raven
#

Dunno if i said this earlier but thanks cuz i managed to fix the dash script by doing this. Pseudocoding is kinda hard to do tho since I'm still not used to coding 🙏

But still thanks this helps so much

smoky raven
sinful zinc
#

what does this mean?

keen dew
#

You have an invalid JSON file

naive pawn
sinful zinc
#

i dont know what it does

#

it lists all my packages

naive pawn
#

it's a lock file, specifying which exact version and url were used

#

you could maybe try having it regenerate?
close unity, pull that file out to some other folder (don't delete it just in case), then reopen unity
if it doesn't work, try that but also delete the library folder

sinful zinc
#

do u know what causes this eror

#

is it from merge conflicts?

naive pawn
#

potentially, maybe

sinful zinc
#

willl it affect any of my packages if i leave the error there

naive pawn
#

most likely

sinful zinc
#

does this mean anything or should i just delete library folder

naive pawn
#

it means it didn't work i guess

#

yeah try a library reset

sinful zinc
#

if i remove the linux modules will this go away

undone wave
#

I'm currently making a level editor, and trying to implement certain editor fields that only appear when another field is set to a specific value
(For example, the float field "Homing Speed" should appear only when the bool field "Homing" is set to true (Enabled))
How would I implement this "condition"?

This is the current implementation I have:

public class EditorField
{
    public string name;
    public System.Type type; // this is used to define what type of UI element will be used for the field (radio button, text field, etc.)
    public List<Condition> conditions; // every condition within this list must be met for the EditorField to appear, altho idk if i'll ever use more than two conditions at the same time, just made a list out of habit

    public EditorField(string name, System.Type type, List<Condition> conditions)
    {
        this.name = name;
        this.type = type;
        this.conditions = conditions;
    }
}

public class Condition
{
    public object field; // the field whose value must be checked, I don't know if this works for value-type variables, probably doesn't
    public object value; // the value the field must have in order for the associated EditorField to appear, should probably be expanded to a list to allow for multiple values when dealing with enums
}```
naive pawn
sinful zinc
#

by the way, is there a way to remove a module from a unity version without having to reinstall the version?

crystal shell
broken mortar
#

is it not possible to use GoogleSignIn with firebase for Arm64-v8a?

stuck trellis
#

batuhan dcgel

steady sand
#

hi guys can some one help me? I can't dowland installs

stuck trellis
#

delete everyting install again

stoic sage
#

Is learning coding hard

steady sand
#

Türkmüsün?

steady sand
rich adder
stoic sage
frail hawk
swift crag
stoic sage
frail hawk
#

in unity or c# in general

#

calculator, to do list etc and unity flappy bird, temple runner

elfin pike
#

very funny when unity puts template grid gizmo in offset and you dont know how to fix it

swift crag
#

i'm not sure what you're referring to

#

can you screenshot this?

elfin pike
#

why they dont give option to offset gizmo or they do it automaticly

swift crag
#

i'm not sure what I'm looking at

#

is there a box collider here?

#

or is that a tilemap grid

elfin pike
#

its tilemap editing

swift crag
#

ah

#

did you paint a bunch of invisible tiles that are now outlined in orange?

elfin pike
#

tilemap is selected thats why its orange and it is intended to be invisble

copper jasper
#

Im trying to add my input reference actions from the unity input system onto a scriptable object this used to work a few months ago but now it doesnt work it just says none even tho its showing the inputs and letting me drag them in and my old inputs arent gone but if i try to change their input action it doesnt let me

using UnityEngine;
using UnityEngine.InputSystem;

[System.Serializable]
public struct InputEntry
{
    public string Name;
    public InputActionReference Action;
}

[CreateAssetMenu(menuName = "Scriptable Objects/Input Data")]
public class InputData : ScriptableObject
{
    public InputEntry[] Inputs;

    public InputEntry Get(string Name)
    {
        for (int i = 0; i < Inputs.Length; i++)
            if (Inputs[i].Name == Name)
                return Inputs[i];

        Debug.LogWarning($"[InputData] No entry for '{Name}'");
        return default;
    }
}
balmy vortex
elfin pike
#

@swift crag where did you go? no helping

frail hawk
#

dude

#

why ping people like this, we are doin this volunatrily if you did not know yet

elfin pike
#

he started to help, but dissapeared

grand snow
#

Also I do not see EventSystem in your scene which is required

#

Create it from the gameobject create menu

balmy vortex
rigid swallow
#

Im following a tutorial right now and they are suggesting that I make a variable that should be accessible by other scripts accessible through getters and setters for cleaner code, but to me it just seems like making a public variable with extra steps. Is there something im missing?

wintry quarry
polar acorn
wintry quarry
#

Often you will do some validation or perhaps fire off events or something in the setter

rigid swallow
#

ok i see

#

thank you both

grand snow
# balmy vortex ya

Confirm you have an event system please and if the component has a warning read it and press the button to fix it

steady sand
#

Guys, I’m installing Unity 6.3 LTS via Unity Hub, but I only see Visual Studio Community 2022 as a dev tool. There is no Visual Studio Code option. What I need to do?

solar hill
#

!ide

radiant voidBOT
naive pawn
solar hill
#

Oh they dont have vs code installed at all?

#

My bad i missunderstood

frail hawk
#

seems like you already installed vs code and selected it already as your IDE

steady sand
#

I selected now

frail hawk
#

make sure to configure it correctly so you get intellisense function

steady sand
#

whats "intellisense function" means

frail hawk
#

code auto complete and code suggestions

steady sand
#

oh ok btw how can I start to code

frail hawk
#

by creating a new script monobehaviour then double clicking so it opens up in vs code

steady sand
#

Oayk I understand. Thanks for everything

ivory bobcat
cosmic oyster
#

and this is saying that the Player.Cs i dont have the public void addcoin but i have

#

so i dont understand

#

and i want to make when i kill a enemy i will get 10 coins as a reward per kill i have from bob

solar hill
#

!code

radiant voidBOT
solar hill
versed stump
#

Player clearly doesn't have anything called AddCoins

#

It's like 13 lines

cosmic oyster
#

what

solar hill
#

also this is very clearly ai generated code

cosmic oyster
#

i have this

#

whattt

solar hill
#

also

radiant voidBOT
cosmic oyster
#

okok

versed stump
#

You also have 2 scripts called Player apparently

cosmic oyster
#

thx guys

solar hill
cosmic oyster
#

i think i found you the problem

#

xD

#

thx guys

frail hawk
#

it is funny how people let ai do the job but when the ai is not able to solve a thing they come and ask here

versed fjord
frail hawk
#

i am saying beginners shoudl avoid using ai too much

#

it is clear they could not solve something really simple

versed fjord
#

If someone builds something and solves real problems, they will face major issues even with AI. Thats when they learn it. Used to be google, now its AI. You also suggest beginners not to use google?

frail hawk
#

i am not going to argue with you because you clearly ignore what i said

#

programming begginers shoudl avoid using ai generated code, for you

versed fjord
slender nymph
#

now explain how someone who doesn't know what they are doing is going to criticize the AI's output.
beginners need to be doing their own research and not relying on the output from something that just predicts what the next text should be without any critical thought

versed fjord
slender nymph
#

or, just do the research in the first place and skip the redundant step where the gets-things-wrong machine tells you something wrong and you have to research it anyway

fickle plume
#

This is an English speaking community.

stuck trellis
#

alright sory man

dusky beacon
#

HELP I DID SOMETHING

#

wheres like everything

slender nymph
#

you're calling GetComponent<CharacterController> on an object that has no CharacterController

dusky beacon
#

nono not the mistake

#

but the window

slender nymph
#

this is a code channel

dusky beacon
#

OH MB

slender nymph
#

but double click the project tab

dusky beacon
#

whats project tab

grand snow
dusky beacon
#

yeah but when i dc nothing happens

shell sorrel
#

where it says project right click

#

there is a maxmize option turn it off