#💻┃code-beginner

1 messages · Page 480 of 1

willow scroll
#

Derived classes?

formal hill
#

Absolutely not no

rich adder
neon ivy
formal hill
rich adder
willow scroll
shell matrix
#

hello, i have this issues and idk how to fix it.

formal hill
formal hill
#

Or I just didnt understand

rich adder
polar acorn
formal hill
neon ivy
rich adder
willow scroll
neon ivy
formal hill
neon ivy
#

using tags or scripts as tags would result in the entire object only being 1 thing

willow scroll
neon ivy
#

the terrain is just an example

willow scroll
#

Use the suggested example if you spawn specific prefabs

rich adder
wet raptor
#

Thanks for your help before, I have fixed that issue with the input system.

I have this error now. Within the function I have:
private void HandleMovement(){
Vector2 inputVector = gameInput.GetMovementVectorNormalised();

formal hill
rich adder
# formal hill The second one is a whole book

a "whole book" is a blogpost length guy have you really no attention span to learn something you bout to use 70% of your time in Unity lol
having detailed explanations are a good thing these days

wet raptor
polar acorn
formal hill
rich adder
wet raptor
#

I have this at the top of my MoveController script
[SerializeField] private GameInput gameInput;

which I think calls from a function that looks like this in my GameInput script

public Vector2 GetMovementVectorNormalised(){
    Vector2 inputVector = playerInputActions.Player.Move.ReadValue<Vector2>();

    inputVector = inputVector.normalized;

    return inputVector;
}
#

PS, how do I format code on here to show it better?

eternal falconBOT
polar acorn
wet raptor
pulsar meteor
#

i cant get my animations to work i can only do idle

willow scroll
polar acorn
wet raptor
#

I dont think I have. All I have is the code that I have put so far. I have this
[SerializeField] private GameInput gameInput;

And then in the function
Vector2 inputVector = gameInput.GetMovementVectorNormalised();

Where GetMovementVectorNormalised is returning an inputVector from my input actions.

polar acorn
pulsar meteor
#

i want to have basic animation i followed a turtorial but i can only get idle animation

formal hill
willow scroll
wet raptor
#

So I understood that GameInput is class with the methods Awake and GetMovementVectorNormalised.

I thought that by instantiating the class at the top of my BadgerMovementController script I would be doing this.
[SerializeField] private GameInput gameInput;

then I could use the method GetMovementVectorNormalised() which is from the gameInput instantiation of the class GameInput assigning the input sytem variables to inputVector

polar acorn
#

you made a variable that can hold a GameInput

#

you still need to tell it which one of those you want that variable to hold

lilac moth
#

Can somebody assist in figuring out proper collisions in unity 3d?

If I make a rotating object kinematic, the player cannot push the object (which is good), but the object doesnt collide properly with the player at higher speeds.

If I make the rotating object non kinematic, the object collision with the player works, but the object gets pushed. This occurs even if I up the mass.

All I want to do is have a rotating object that collides with the player at higher rotation speed (not a very high speed)

formal hill
polar acorn
neon ivy
formal hill
willow scroll
polar acorn
wet raptor
formal hill
polar acorn
wet raptor
#

Yes, I think I understand now.

#

Thanks for that.

willow scroll
formal hill
wet raptor
#

The field is literally the part in unity that you can drag and drop things into?

#

So when we SerializeField it is kind of like making it available to the engine?

willow scroll
#

No, drag & drop is only supported by specific types

willow scroll
wet raptor
#

Yes thanks, that is what I mean. Very helpful.

polar acorn
willow scroll
#

This makes myString visible in the Inspector

[SerializeField] private string myString;

This does not show myString in the Inspector, but still keeps it persistent across the game sessions

[SerializeField, HideInInspector] private string myString;

This makes other serialized myRef references not affected by this one

[NonSerialized] public YourClass myRef;
wet raptor
#

Yes, thank you I think I do understand this part fairly well.

#

I dont think my issue is as simple as just instantiating (assuming this is indeed the right way to instantiate this class) in the start method with:
gameInput = GetComponent<GameInput>();

It does not fix my issue. And this also stops the movement I had previously.

willow scroll
#

Where is the original issue?

wet raptor
#

Well the error log says it's the line:
Vector2 inputVector = gameInput.GetMovementVectorNormalised();

willow scroll
#

Since gameInput is null?

wet raptor
#

With the null reference :/

willow scroll
#

Is the reference successfully assigned after getting the component?

wet raptor
#

How would I check for that? Debug.Log gameInput in my update method?

willow scroll
#

Debug it after the assignment

wet raptor
#

Ah, no it isnt. It's null.

willow scroll
#

What does it mean?

wet raptor
#

(assuming you ask this to see if I understand something?) I think I must have something wrong with the actual GameInput class.

willow scroll
#

What might be wrong with it?

wet raptor
#

The naming is all okay.

I see that in the inspector when the game starts the game input field goes to null.

polar acorn
willow scroll
#

If it's null, then there is no GameInput component attached to the object

wet raptor
#

But am I not attaching the component here?

willow scroll
polar acorn
willow scroll
#

GetComponent is gameObject.GetComponent, which gets the Component, attached to the MonoBehaviour's GameObject

#

You don't have to use it if you are already referencing it in the inspector. Just make sure that you don't change the variable anywhere else, as mentioned by digiholic above

#

Press Ctrl + F and type the field's name to find its references

wet raptor
willow scroll
#

Then this should work without attaching the script to class, assuming the GetComponent line is removed

#

You might want to show the move logic too

wet raptor
#

okay so removing the GetComponent line means the Badger moves around, I get the same Null error though, which I dont understand. How can gameInput be null but I still can use the input to move the object.

My movement logic as so:

        Vector2 inputVector = gameInput.GetMovementVectorNormalised();

        Debug.Log(inputVector);

        Vector2 moveDirection = new Vector2(inputVector.x, inputVector.y);

        // Rotate input to match isometric view
        moveDirection = new Vector2(moveDirection.x - moveDirection.y, (moveDirection.x + moveDirection.y) / 2);


        // Move the badger
        rb.MovePosition(rb.position + moveDirection * moveSpeed * Time.fixedDeltaTime);

        // Move the badger 
        if (moveDirection != Vector2.zero)
        {
            lastNonZeroMoveDirection = moveDirection;
        }
    }```
#

The debug log shows values going to 1 etc when pressing wasd

willow scroll
wet raptor
slender nymph
willow scroll
wet raptor
#

Only a single copy of the script GameInput. I have a GameInput in my hierarchy, but that should not be the problem right? You can have a script the same name as the item in the hierarchy.

slender nymph
#

not multiple copies of GameInput, multiple copies of whatever the component you showed the code for

#

because your gameInput variable is not assigned on one of those

cosmic dagger
slender nymph
#

more specifically use t:ScriptName to search for the component

#

the t: part is important because it searches by that type, otherwise you'd be searching for gameobjects with that name

wet raptor
#

Yes, I think I had gameInput assigned to my animator script as well.

#

Ok. so deleting the BadgerMoveController script resulted in errors. Attaching it back fixed the issue... I have no idea how this has worked but it's further than it was.

#

This is hard... haha

#

I am okay with programming with Python, I think I get really confused at understanding the Unity interface.

slender nymph
#

it usually helps to say what the errors are. but have you actually checked the scene for multiple copies of this BadgerMoveController component like i've been saying to do?

wet raptor
#

Yes, as I said I thought that this one was attached to both the parent object and the animation controller script.

slender nymph
#

you said that about GameInput

wet raptor
#

Sorry yes you are right

#

my mistake

slender nymph
#

or did you mean that you had assigned your Animator object to the gameInput variable on another copy of the component? if that is the case, you are absolutely using the wrong type for your variable

#

there is almost never a need to use a variable of type GameObject. use the actual component type you want to access instead

#

then you'll almost never need to use GetComponent and you'll never be able to assign an object that doesn't have the desired component to the variable

wet raptor
#

Alright, cheers.

#

I need to do much more reading I think.

#

And more trial and error

queen adder
#

Oh i believe it is the otherCollider. Yep found it. I hate the way my VS is not showing the codes always!

pulsar meteor
#

how can i add movement plus animations has anybody a good turtorial i can only find bad ones

steep rose
eternal falconBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

rich adder
hybrid tapir
cosmic dagger
polar acorn
hybrid tapir
#

nope

#

i have is trigger on on all the walls i can crash into and on the plane

polar acorn
#

You're checking for a collision

#

not a trigger interaction

hybrid tapir
#

oh

hybrid tapir
polar acorn
hybrid tapir
#

yes

polar acorn
#

CharacterControllers do not like being teleported. You can either disable it, set the position, and re-enable it, or call Physics.SyncTransforms() after the teleport

polar acorn
hybrid tapir
#

both

#

i gotta go to work now Sadge

polar acorn
#

You can't have both, you need to pick one or the other

ripe vigil
#

hat do i do

#

what

polar acorn
#

If you want to use Maya files, you need to have Maya installed

ripe vigil
#

how

polar acorn
#

how what

ripe vigil
#

what maya

#

and how do i instal it#

polar acorn
#

The same way you install basically any other program

ripe vigil
#

what

#

can u just tell me how plz

polar acorn
#

How did you install Unity?

#

You went to their website and downloaded it then ran it

#

So do that

ripe vigil
#

its not called unity tho

#

its called unreal engin sounds bad

polar acorn
#

Ah nevermind it's another problem child wasting everyone's time

ripe vigil
#

also

#

it says to buy maya

#

is there a way to get it for free? @polar acorn

rich adder
ripe vigil
#

im not

#

im just asking if there is a way

#

to get this to work

#

cus its saying something about it not working

rich adder
#

if you need maya you install it, if you dont have it buy it or dont use files reliant on it

ripe vigil
#

how do i do that

#

i have a .mb file

polar acorn
ripe vigil
#

can i use a obj

rich adder
#

then delete it

ripe vigil
#

ok

rich adder
#

or convert it

ripe vigil
#

done

long jacinth
ripe vigil
#

Allocation of 32 bytes at 0000022CA17E1B70

Allocation of 32 bytes at 0000022CA1470BE0

TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 64

Internal: Stack allocator ALLOC_TEMP_MAIN has unfreed allocations, size 64

To Debug, run app with -diag-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.

Allocation of 32 bytes at 0000022CA17E1B70

Allocation of 32 bytes at 0000022CA1470BE0

Allocation of 32 bytes at 0000022CA17E1B70

Allocation of 32 bytes at 0000022CA1470BE0

TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 64

Internal: Stack allocator ALLOC_TEMP_MAIN has unfreed allocations, size 64

To Debug, run app with -diag-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.

Allocation of 32 bytes at 0000022CA17E1B70

Allocation of 32 bytes at 0000022CA1470BE0

what do i do to fix this

rich adder
ripe vigil
#

ok thx

rich adder
rocky canyon
#

here, its ez right click a message and Start Thread

ripe vigil
#

random things not working

long jacinth
rich adder
#

zoom out

rocky canyon
#

@rich adder did u fix ur gizmo/camera issu?

rich adder
long jacinth
rich adder
long jacinth
#

yes

rich adder
#

huh why is player floating

#

maybe enable these too so we can see more info

long jacinth
rich adder
# long jacinth

prob have to select the navmesh agent by itself in playmode to see the path plotted on

long jacinth
#

how do i select it on its own

#

u mean i disable every component but that

rich adder
#

i mean just select the CircuitBug

long jacinth
rich adder
# long jacinth

try moving agent.SetDestination line by itself In Start() and see if its working

queen adder
rich adder
queen adder
#

Yes. After some researches, they didnt implemented this due to PhysX bullsht. But 2D senior developer told in one article: "I opt for OnDisableTriggerExit" so which was already what i was going to do.

#

With UnityEngine.Pooling system i was able to get the performance i need by not creating a list for every collision or trigger

ripe vigil
#

what to do about this thing

#

it keeps repeating

slender nymph
#

have you tried restarting the editor?

ripe vigil
#

its growing

ripe vigil
queen adder
#

i really cant figure out how to get my bullets to instantiate 90 degrees right

slender nymph
#

Instantiate requires a Quaternion for the rotation parameter, luckily you can use Quaternion.Euler to create one from euler angles

slender nymph
#

and you are certain that nothing else affects its rotation? there's no physics like a Rigidbody2D that can rotate it, or any code like assigning a parent that rotates? and that when you instantiate it with Quaternion.identity as the rotation it points exactly along an axis?

queen adder
rare basin
#

and you typed quaternion instead of uppercase

slender nymph
#

that's still correct, it's just the quaternion struct from unity's Mathematics package

rare basin
#

ah

slender nymph
#

it has an implicit cast to UnityEngine.Quaternion so it's fine

queen adder
slender nymph
#

it's configured

queen adder
#

oh okay

slender nymph
#

if it weren't then that red underline you showed with your first screenshot would not have appeared

#

but you should show the inspector for the instantiated object

#

ideally the hierarchy too

queen adder
#

the capital fixed it

#

it works now

#

amazing

slender nymph
#

ah, i see what the issue was now. Mathematics.quaternion uses radians in its Euler method

#

UnityEngine.Quaternion uses degrees

queen adder
#

would this work as intended? trying to make it so when the object collides with another specific object, it changes colour, and stays the default colour while not colliding with it

#

im quite sure that colliding = true wouldnt be applicable to everything else but i have no idea to make it like a global change

wintry quarry
#

Also you can just do else {

#

You don't need else if and a whole nother condition

queen adder
#

do i scrap the colliding variable or

wintry quarry
#
if (colliding) 
{
}
else {

}```
#

Also yeah you really don't need Update here

#

You can just change the color in OnTriggerEnter2D and Exit2D

#

There's no need to check every frame

queen adder
#

youve lost me i have no idea what to write here

wintry quarry
#

Just put the color change stuff directly in OnTriggerEnter2D

#

Instead of colliding = true

queen adder
#

i tried this exact thing before and it just took the else as like a final verdict

#

and kept it the same colour

#

like this?

deft grail
# queen adder like this?

if the collided gameobject has tag Player it will change to that colour, if it doesnt have the Player tag then it will run the else statement

queen adder
#

didnt work

deft grail
bleak mist
#

Anyone know how to make semi-colon get added automatically on save using C# with VScode?

queen adder
#

this isnt the outcome i wanted

#

i wanted it to change colour when touching the collider

#

and turn back to normal when not being touched

devout flower
#

Debug the collider’s object’s tag in other (unless the enter code works)

queen adder
#

what do i put there

deft grail
queen adder
#

so i dont need the else

deft grail
#

it just does if you collide with Player it does X otherwise it does Y

queen adder
#

well i was told to use else so dont look at me gulp

slender nymph
#

you also don't need the GameObject.Find if the Renderer you want to change is on this object (or the one colliding)

deft grail
#

you were told to use OnTriggerExit

queen adder
deft grail
#

instead of checking a whole else if

queen adder
#

like this?

deft grail
#

unless you want it to just run if it exits any collision that it detects

queen adder
#

would doing the exact same code as the top bit even work

deft grail
queen adder
#

i dunno it just looked like it wouldnt

slender nymph
#

another thing that needs to be pointed out is that your color constructor parameters are wrong. Color uses a float from 0 to 1

queen adder
#

i copy pasted it from a website i have no idea what else to use

deft grail
slender nymph
#

divide those values by 255f if you want to use a value from 0 to 1. otherwise use Color32

queen adder
#

i have

#

zero idea what youre saying this is why i copy pasted

#

seemed to work for me

#

it works catto

#

though the objects dont collide regularly

#

is there a fix for that

deft grail
slender nymph
#

define "collide regularly"?

queen adder
#

the two objects ive been using dont collide

slender nymph
#

also keep in mind that trigger colliders are not solid

queen adder
#

ive got two colliders on my object

#

the regular circle collider for the actual object

#

and a second larger box collider as like a hitbox of sorts

#

the regular circle collider doesnt collide with the other object

slender nymph
#

trigger colliders are not solid

queen adder
#

the circle collider isnt a trigger

#

the box one is

#

is it because the box is like overlapping the circle maybe?

slender nymph
#

no, either the other object has a trigger collider on it or you are not moving in a physics friendly way

deft grail
queen adder
#

my movement script is pretty jank

queen adder
#

i dont know what you mean

slender nymph
#

how are you moving

queen adder
#

should i copy paste my movement script here

#
private float _speed = 5.0f;

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
    float horizontalInput = Input.GetAxis("Horizontal");
    float verticalInput = Input.GetAxis("Vertical");

    Vector3 direction = new Vector3(horizontalInput, verticalInput, 0);

    transform.Translate(direction * _speed * Time.deltaTime);
}
slender nymph
#

transform.Translate does not respect collisions

queen adder
#

got any other scripts i can use

deft grail
queen adder
#

it weirds out on collision

#

smudges into the other object a little

#

and is all around kinda floaty

slender nymph
# queen adder got any other scripts i can use

nobody is going to just hand you working code for free. consider going through some basic courses like the pathways on the unity !learn site to learn wtf you are doing instead of expecting to just copy/paste everything

eternal falconBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

deft grail
#

just adapt your code instead of trying to copy paste more scripts that you dont understand

slender nymph
#

then i won't help you. good luck.

queen adder
#

dont just assume that i blindly shove whatever i find into there sob emoji sob emoji

deft grail
#

use either .AddForce or directly set the velocity .velocity with a Rigidbody, and it should be colliding fine

queen adder
#

can you walk me through what you uh.mean by that

#

i replace the transform.translate with those but how do i format those

#

is it just the exact same but transform.translate is replaced with .addforce?

static wasp
#

unity is being dumb again, do i restart it?
my code:
script 1:```cs
public static float player_health = 100;

script2:```cs
player_health -= 5;

error: ```
Assets\Scripts\Enemies.cs(43,13): error CS0103: The name 'player_health' does not exist in the current context

static wasp
#

thx

#

weird how it didn't tell me that there was a problem in vs code tho

strong wren
static wasp
strong wren
#

Both should catch this

static wasp
#

i think it's because i had vs code open for 13 days straight

#

lemme restart it

#

weird

#

it still doesn't tell me about errors

queen adder
#

@deft grail sorry for the ping, tried this but i get the "Object reference not set to reference of an object" error, not sure what to do

private float _speed = 5.0f;
private Rigidbody2D rb2D;

void Start()
{ 
    rb2D = gameObject.AddComponent<Rigidbody2D>();
}


// Update is called once per frame
void Update()
{
    float horizontalInput = Input.GetAxis("Horizontal");
    float verticalInput = Input.GetAxis("Vertical");

    Vector3 direction = new Vector3(horizontalInput, verticalInput, 0);

    rb2D.AddForce(direction * _speed * Time.deltaTime);
}
static wasp
#

i changed it to debug console and then back to problems and now it shows errors

#

weird vs code bug ig

deft grail
#

and just add it yourself in the inspector

queen adder
#

where

deft grail
queen adder
#

would i have to make it public?

#

to add it in the inspector

deft grail
queen adder
#

how am i meant to add it in the inspector if its private

#

theres nothing to add to

deft grail
#

not assigning the variable

#

GetComponent will assign it

queen adder
#

uhmmI think im lost here

#

what do you mean by component,,

#

the script?

deft grail
#

that you need to add to your GameObject

#

in the inspector

queen adder
#

i already have rigidbody2d on my object

deft grail
queen adder
#

i dont get the error anymore but i cant move

deft grail
#

just use GetComponent and your set

queen adder
#

slash forgot

deft grail
queen adder
#

so do i make it a vector2

#

and remove that

deft grail
queen adder
#

oh wait no

#

oops wrong bit sorry

deft grail
#

is this a top down game?

queen adder
#

more of an experiment probably wont become anything

deft grail
queen adder
#

yeah

#

still cant move

deft grail
queen adder
#

oh by the way is there a reason for most variables i see having a _ by the side

deft grail
queen adder
#

still doesnt work sadok

deft grail
#

show the updated code and the inspector of your gameobject?

queen adder
#
private float _speed = 5.0f;
private Rigidbody2D rb2D;

void Start()
{ 
    rb2D = GetComponent<Rigidbody2D>();
}


// Update is called once per frame
void Update()
{
    float horizontalInput = Input.GetAxis("Horizontal");
    float verticalInput = Input.GetAxis("Vertical");

    Vector3 direction = new Vector3(horizontalInput, verticalInput, 0);

    rb2D.velocity = direction * _speed;
}```
deft grail
#

freeze just the rotation

queen adder
#

wasnt an issue with the other script oopsie

#

ive forgotten quite a bit

deft grail
queen adder
#

works fine now

#

thank you

deft grail
queen adder
#

how do i do that

deft grail
queen adder
#

where do i put that

deft grail
queen adder
#

did that actually

deft grail
queen adder
#

uhh wait i thought i had it

#

i tried Vector3.Normalize()

#

the example i saw said that

#

didnt work

deft grail
#

normalize the direction vector

queen adder
#

what does this mean

#

where do i put the normalize

#

ive tried in front of the vector and the direction

deft grail
#

😭

#

on your direction vector

#

you can do this on a new line if you wish

#

to not confuse yourself

queen adder
#

i dont know what you mean by that

#

do i make a new line like

#

direction.normalize()

#

and thats it

deft grail
queen adder
#

i googled it but nothing i saw was referencing any actual examples

#

WOAH that fucked it up hard

#

what does normalize even do

deft grail
queen adder
#

just what i wrote

#

direction.normalize()

deft grail
queen adder
#

directly under the vector3

deft grail
queen adder
#

gaah effort

deft grail
queen adder
#

moves a seemingly random amount after i let go

deft grail
mellow sorrel
#

is it weird that C++ is easier for me than python

#

idk it just feels easier to pickup

deft grail
mellow sorrel
#

oh

#

😭

#

unity only forgor

mellow sorrel
#

stupid

mellow sorrel
#

im kidding

#

oh mb

#

lol

queen adder
#

okay works well

#

not exactly sure wherte to go from here actually

deft grail
#

add an enemy?

queen adder
#

im thinkingg

#

the entire point of that changing colour object

#

was to at a very basic level copy the tables from enter the gungeon

#

im assuming theres a way to like

#

swap objects

#

the colour change is to highlight that its in range to be used

#

and id press a button to swap the object into something else

deft grail
#

you can do pretty much anything in the collision

queen adder
#

iiiii wouldnt know where to start hold on

#

okay basic things can i change that colour swap into more of a

#

highlight

deft grail
queen adder
#

like a glow around the borders

deft grail
queen adder
#

i have no idea how to play animations or use the collision or change properties of a rigidbody2d

deft grail
queen adder
#

i dunno it just sounds weird

#

is that what most people do?

deft grail
#

but its paid i think

#

the asset uses shaders, but you just dont have to make it yourself

queen adder
#

uhhhm ill just

#

make sprites

#

gaah somehow the new movement script fucked up the colour change script

deft grail
queen adder
#

it just doesnt change colours

#

gives me a weird error

deft grail
queen adder
#

assertion failed on expression: go.isactive()

teal viper
queen adder
#

the huh

#

please keep in mind im an idiot thinksmart

slender nymph
#

this stuff is why you should actually make an effort to learn from a structured course instead of trying to brute force your way through this by copy/pasting everything

queen adder
#

did you not read what i said

#

i dont just spam paste whatever i see

#

i read and look up whatever im looking at

#

to at least get some idea of what it means

#

listening to courses isnt for me it doesnt stick i like to do things from experience

teal viper
queen adder
#

it says nothing more than that and stacktrace

#

and id prefer to ask actual experts before blindly googling what might not even be important

#

how would i know stacktrace means anything

teal viper
#

Well, then look at the damn stack trace. You said you don't know what it is.

queen adder
#

how was i supposed to know its important before asking

teal viper
queen adder
#

asking a question wont kill anyone

teal viper
#

Are you gonna actually provide the info or not?

queen adder
#

dlich can you like calm down im not hurting anyone

steep rose
#

stop fighting

teal viper
#

Ugh... Okay, I'm outta this one.

radiant frigate
#

https://gdl.space/imosuresos.cpp i am doing a pinball flipper and want it to rotate until a certain point(in this case either max rotation while holding down the D key or minRotation if viceversa) but it keeps just going until +5 or -5 in the z axis and doesnt rotate until the 25 or -15 am i missing something?

queen adder
#

this is what it says

teal viper
queen adder
teal viper
# queen adder this?

Yes. You can see that it's your script causing it.
The rest you can investigate on your own. Learn what a stack trace is.

queen adder
#

looks way too complicated and i dont think its needed

#

looks like its an issue with my ontriggerexit

rocky canyon
#

yup, exactly

#

on line 35

queen adder
#

doesnt exactly say whats wrong with it

#

im at a bit of a loss

radiant frigate
#

wait i used transform.rotation.y instead of .z

#

💀

teal viper
# queen adder im at a bit of a loss

Didn't you say that you prefer to learn on the go? If so, you should be googling every single thing you don't understand and digging into documentation. If you can't do it, this is not a correct learning method for you and you should go over courses as suggested previously.

queen adder
#

it literally gives no information on the error

#

but i solved it anyway

#

only issue is i probably need a better way to change the colour of an object

teal viper
queen adder
#

i showed you everything that the error told me

deft grail
teal viper
queen adder
#

i need to do it within code

#

i didnt need to because ive solved the error

#

i think i know what it was anyway

#

the way i got the objevt was way too complicated i entirely forgot this script is only used on THE actual object

#

so i didnt need to find it

teal viper
#

Not gonna get very far if you keep that way of thinking.

queen adder
#

dlich can you hooooop oooooooff

#

what is your issue with me im only asking questions youre being a debbie downer

#

i need a better way of doing this

deft grail
queen adder
#

i didnt exactly understand what you meant

#

can you like explain more pretty please

marble hemlock
queen adder
#

sorry that sounds sarcastic

deft grail
marble hemlock
#

like the idea is "hey okay now that you clicked e on this thing the raycast hit, and it qualifies as something you can indeed pick up, put it in the ItemHeld slot in the inspector"

teal viper
queen adder
radiant frigate
queen adder
#

can you write out an example

marble hemlock
#

oh i feel like i put too much in the thing

deft grail
queen adder
#

im not good at deciding what would be replaced

#

no like

deft grail
marble hemlock
#

okay just in general, how can i set it up where the object is intended to be removed and moved from the slot?

deft grail
#

and assign the variables in the Inspector

queen adder
#

im lost notlikethis

deft grail
#

as simple as it gets

teal viper
teal viper
queen adder
#

this cant be right gaah it isnt clicking

deft grail
queen adder
#

ooh type color

#

i didnt know that was a thing

deft grail
queen adder
#

and for the renderer variable

#

what does serializefield do

#

and wouldnt private make it so i cant see it in the inspector

deft grail
queen adder
#

oooooohh

#

fixes that issue

marble hemlock
#

it was giving me a message but i hadnt realized that was why

#

idk what to do though

#

not sure how id implement a field that is designed to have different things take its position

queen adder
#

says myRenderer doesnt have a definition for color

deft grail
queen adder
#

renderer

deft grail
queen adder
deft grail
queen adder
#

nope

deft grail
#

you dont access .color from the renderer

deft grail
#

ive never used a Renderer so i didnt notice

queen adder
#

so uhm

#

what do i do

steep rose
#

seems like your ide is not configured

deft grail
steep rose
#

from what im seeing

deft grail
queen adder
#

fuck am i meant to be seeing,,,,,,,

deft grail
#

how you access .color

queen adder
#

.material?

#

do i include that

steep rose
deft grail
queen adder
#

oh cool i actually figured it out

steep rose
#

as long as it is autocompleting you should be fine

deft grail
#

might just be missing Unity extension on VScode i think it is

queen adder
#

wait waitt

#

fatal flaw i think

#

i wanted to switch between the two colours

#

i have one option

#

do i change the original objects colour

deft grail
steep rose
#

oh yeah it seems to be configured 😅

deft grail
#

you need 2, you have 1, i wonder what your supposed to do

queen adder
#

do i need a second serializefield for renderer

#

not showing up in inspector

#

im gonna have to assume so the second colour isnt either

deft grail
queen adder
#

so serializefield works for one variable only

queen adder
deft grail
#

if you fail to assign it in the inspector, you will error

queen adder
#

yeah but thats a line of code that i dont know from heart

#

whereas i can just write what i already know

#

and not forget

#

error proof

deft grail
#

literally 3 words

queen adder
#

i dont know getcomponent

deft grail
queen adder
#

anyway its still signficantly easier to just copy paste serializefield

#

and add in the renderer

#

though probably not because the shit didnt work grin emoji

#

it turns invisible when i go up to it

deft grail
queen adder
#

hold on

#

no i fixed it

#

they just default to transparent for some reason

#

yay now my little square turns a darker brown when i go up to it

#

joyous day

deft grail
queen adder
#

yeah i did that

#

honestly i would much prefer the outline

#

isnt it paid?

steep rose
#

isnt what paid?

queen adder
#

shaders to outline an object

deft grail
steep rose
#

im not sure why it would be paid 🤔

marble hemlock
queen adder
#

oh hes using something ive never seen before

#

i might be a while

steep rose
#

well the shader graph does that

queen adder
#

i have a better idea i think

#

can you switch sprites of a gameobject

deft grail
queen adder
#

i can just make another since its just a simple square

deft grail
queen adder
#

id rather stay with the basics

steep rose
#

i would just learn how to use shader graph

#

and everything else

marble hemlock
#
  1. Raycast hits object
  2. Object has the pickup layer, so Unity returns a debug log telling you that it can be picked up.
  3. Clicking E, will send the debug log that you picked up the object.

the problem is that I tried to set it up in a way where whatever object you clicked on would go into a public game object class called ItemHeld

queen adder
#

before i even know how to code

steep rose
#

then !learn

eternal falconBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

queen adder
#

kinda what im doing right now

marble hemlock
#

this is a great way to get started with learning programming in unity, and the videos are short and sweet with demonstrations

steep rose
queen adder
#

no

#

i haaaate courses

marble hemlock
#

no

queen adder
#

im learning my own way

marble hemlock
#

stop

#

no

#

listen

queen adder
#

i wont learn anything from a course

#

trust me

steep rose
#

what?

#

how

marble hemlock
#

you wont learn anything trying to follow along tutorials without knowing the basics

queen adder
#

it doesnt stick

#

i get so bored

marble hemlock
#

they're like 5 minute videos

queen adder
#

i dont like having information spat at me

steep rose
#

then coding shouldnt be for you

queen adder
#

i wanna do it myself

marble hemlock
#

all due respect, thats not going to work

queen adder
#

worked for python

frosty hound
#

@queen adder Can you stop flooding this channel.

#

Make a thread if you're going to thought dump

queen adder
#

oh my bad i tend to send more sentences at once than a single long one

frosty hound
#

You're also just talking nonsense. This isn't the place to spam questions just because you refuse to learn with the resources available.

queen adder
#

ive just been asking questions and applying them? i dont see the harm

#

its been helping me

marble hemlock
#

oh boy

#

kayla are you watching tutorials?

frosty hound
#

We don't do handholding here. If you're finding yourself asking questions for every little single beginner thing, use threads.

queen adder
#

i always forget those exist oopsie

marble hemlock
#

like when you want to do something, do you specifically look up a tutorial?
Like say you want to make a movement script, do you simply look up a movement script related to 2d or 3d unity?

queen adder
#

yeah

#

i look up things and also cross reference it with questions here

#

ill make a thread hold on

teal viper
marble hemlock
#

ye
it keeps hitting me with a "there is no reference for itemHeld" and i'm just like
well yeah the reference is supposed to be constantly swapped out. when you're not holding something, its not supposed to have anything referenced because you arent holding anything

queen adder
#

stupid class for stupid people (kayla

teal viper
marble hemlock
#

well to be exact it says:
UnassignedReferenceException: The variable itemHeld of PickupScript has not been assigned.
You probably need to assign the itemHeld variable of the PickupScript script in the inspector.

teal viper
marble hemlock
#

something else broke and im going to try to fix that

#

okay idk why but the rigid body of one of my objects is no longer working 😮‍💨

#

fixed the other thing it had nothing to do with the rigidbody

#

nvm it broke again 👍

teal viper
marble hemlock
#

the error isnt showing up in VS but on unity

#

and where it says the problem is

ivory bobcat
marble hemlock
#

this silly bit right here

marble hemlock
teal viper
marble hemlock
#

i want it, upon clicking e, to say that the object it just collided with is now equal to itemHeld

i dont even know if im even on the right track

teal viper
marble hemlock
#

well i understand the error, and why its giving me the error

#

i didnt put anything into the itemHeld gameobject variable

#

should i just make an invisible object and that becomes the reference 🗿

teal viper
teal viper
marble hemlock
#

i want it to stop complaining that there is no reference

#

i meant more like an empty parent object

#

but i want whatever is in the itemHeld slot to be replaceable by the another object if I click on it

#

and something completely unrelated broke this is rough

teal viper
marble hemlock
#

im gonna try again and take it apart

#

it cant be this complicated

#

im almost there

teal viper
#

Don't try again. Try understanding and fixing the issue first

#

Answering my questions might help with that.

marble hemlock
#

well if i put an empty parent object in there, it would stop asking for a reference object
its upset it doesnt have a reference because i'm telling that reference to become a child of another object
i tried slotting my flashlight into the slot and it works

#

sort of

#

it follows what the script is expecting itemHeld to do, but its still saying that there is no reference when i run the code

teal viper
#

Wouldn't you think that's the most natural way to prevent it from complaining?

marble hemlock
#

well by default you're not supposed to be holding anything, and when you click e, it'll pick it up

#

but i might be working backwards actually

teal viper
#

Let's start simpler. What does the error mean? What value would your variable need to have for this error to appear?

marble hemlock
#

i may not be understanding your questions

teal viper
#

Then ask for clarification. What part do you not understand?

marble hemlock
#

i dont know what you mean when you ask what the error means
its saying that there is no reference, which makes sense, because itemHeld is meant to be a GameObject

#

im gonna lay down for a bit until something loads in my head

teal viper
marble hemlock
#

nothing

teal viper
#

No. There's no such thing as a variable that doesn't have a value in code.

#

What value does a reference type have by default?

#

Have you ever heard of null?

marble hemlock
#

gonna take a short break

#

maybe will be better if i clear my head

static cedar
#

Hi peps, wondering how am i gonna draw a grid?
Like this, just draw the lines infinitely. I just need some place to get some vague idea or tool how am i gonna achieve this.

teal viper
marble hemlock
#

i think im doing it wrong

#

im going to try to create a flowchart of what im trying to do so i can better visualize what i want to interact with what

#

i might not even need 2 scripts for this

teal viper
static cedar
#

I first looked at mesh honestly.

#

But either way, i never tried em, so gonna have to learn em first.

marble hemlock
#

okay figured it out

#

sort of

#

i mean something else broke but sure

#

improvement

#

i told it to make itemHeld, whatever the game object hits (assuming you've clicked E), which then references the pickup event in the same script, that now has the information that itemHeld now has a value

and then after that, i go "well if itemHeld != null", then do the things

#

something completely unrelated broke but im making progress i suppose 👍

hybrid tapir
hybrid tapir
#

wait a darn minute

#

so
defaultValues = player.transform;
makes it update even though i put it in the START method?

teal viper
#

If you need an answer, you should provide a bit more info on what you're doing

eternal needle
#

from the single line of code i see, you're seemingly assigning a Transform to the defaultValues and probably printing out the position. Nothing about this has to do with Update, Transform is a reference type. itd be kinda weird if you stored a reference to a transform yet none of the values updated when you wanted the position

hybrid tapir
#

yes i guess ill have to do its values seperately to have the initial values

versed zinc
#

im making a 3D shooter game rn, working on interactions. I have my Interact() marked as override but it still gives me this error:
Assets\Scripts\Interactables\Keypad.cs(18,29): error CS0506: 'Keypad.Interact()': cannot override inherited member 'Interactable.Interact()' because it is not marked virtual, abstract, or override
any help?

fluid oxide
#

`using UnityEngine;

public class PlayerShooting : MonoBehaviour
{
public GameObject bulletPrefab; // The bullet prefab to instantiate
public Transform firePoint; // The point where bullets are fired from
public float fireRate = 0.5f; // Fire rate in seconds
private float nextFireTime = 0f;

void Update()
{
    // Get the mouse position in world space
    Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    mousePos.z = 0; // Ignore Z axis for 2D

    // Calculate the direction between the gun and the mouse position
    Vector2 direction = (mousePos - firePoint.position).normalized;

    // Rotate the gun towards the mouse
    float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
    firePoint.rotation = Quaternion.Euler(new Vector3(0, 0, angle));

    // Shoot when the left mouse button is pressed and cooldown allows
    if (Input.GetMouseButton(0) && Time.time >= nextFireTime)
    {
        Shoot(direction);
        nextFireTime = Time.time + fireRate;
    }
}

void Shoot(Vector2 direction)
{
    // Instantiate the bullet at the fire point
    GameObject bullet = Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
    BulletMovement bulletMovement = bullet.GetComponent<BulletMovement>();
    
    // Set the bullet's direction
    bulletMovement.SetDirection(direction);
}

}
`
i told chat gpt to make me an bullet script but everytime i press click it dosent shoot pls anyone

#

and this is my bullet script
`using UnityEngine;

public class BulletMovement : MonoBehaviour
{
public float speed = 10f;
private Vector2 moveDirection;

public void SetDirection(Vector2 direction)
{
    moveDirection = direction.normalized;
}

void Update()
{
    transform.Translate(moveDirection * speed * Time.deltaTime);
}

// Destroy the bullet after a certain time or when it goes off-screen
private void OnBecameInvisible()
{
    Destroy(gameObject);
}

}
`

pulsar meteor
#

it gives this error

#

but here is the bool

slender nymph
#

that's a warning not an error, but make sure that there is no whitespace in the parameter name

snow warren
#

hello

#

i need some serious help

queen adder
snow warren
#

suppose i have a scroll rect

#

and i add some content into it at runtime

#

normally scroll rects do not align them automatically

#

what i want is to align the scroll rect automatically

#

with C#

#

how can i do that

#

my bad

#

i didnt know about the layout group

ripe vigil
#

can someone help me please im trying to get a animation to work but whenever i press whats suposed to do it nothing hapens

vale marlin
idle ginkgo
#

if i want to instantiate a particle effect before a box gets destroyed
how do i do it ?
like cuz after the object is destroyed the particle is also destroyed with it

ripe vigil
#

i need help im following a tutorial but for them the debug stops and for me it continues

#

this is my code

#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;

public class animatehandonimput : MonoBehaviour
{
public InputActionProperty pinchAnimationAction;

public Animator handAnimator;

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
   float triggerValue = pinchAnimationAction.action.ReadValue<float>();
   handAnimator.SetFloat("Trigger", triggerValue) 




}

}

#

it just spam this

#

anyone know what to do?

rustic maple
#

i get this error when i try to do a certain action with E "ArgumentNullException: Value cannot be null.
Parameter name: source" this si my script: https://gdl.space/yogonumihi.cpp

#

i also tried "KeyButtonDown("pickup"), and then in unput manager make one with the name pickup but that didnt work either

short hazel
rustic maple
#

oh wow i didnt know i HAD to already put the sound because i later wanted to add an other sound, but thank you so much it finally works!

vestal adder
#

of the particle effect

idle ginkgo
#

problem fixed

ripe vigil
#

what the hell do i do

#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;

public class animatehandonimput : MonoBehaviour
{
public InputActionProperty pinchAnimationAction;

public Animator handAnimator;

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
   float triggerValue = pinchAnimationAction.action.ReadValue<float>();
   handAnimator.SetFloat("Trigger", triggerValue) 




}

}

teal viper
ripe vigil
#

ok

short hazel
#

Instructions must end with a semicolon ; in C#. Your mistake is on line 22, as the error says

...animatehandonimput.cs(22, 54) ...

#

Compare with what you have on the line above

atomic holly
#

Hello,
I try to create a weapon system with classes. It works but I want to put some delay between the function can be recalled. I wanted to use coroutine but I can't do this with classes if I understand. How I can do it ?

public abstract class AttackBehavior
{
    public abstract void Attack();
}

public class BowAttackBehavior : AttackBehavior
{
    public override void Attack()
    {
        BowSystem.instance.ThrowArrow();
        //Wait 2 seconds after use this function
    }
}
short hazel
#

You can declare a "coroutine method" just fine, you'll have to start it from a class that derives from MonoBehaviour

long jacinth
atomic holly
#

I don't understand. the function SetAttackBehavior() works but the value of weaponcooldown is not transfered to the PlayerDamage script. Why ?

using UnityEngine;

[CreateAssetMenu(fileName = "New Weapon", menuName = "Inventory/Item/Weapon")]
public class Weapon : Item
{
    public int damage;
    public int reach;
    public int speed;
    public float weaponCooldown;

    //What function weapons we will use
    public weaponAttack attackType;
    public AttackBehavior attackBehavior;

    public enum weaponAttack
    {
        Bow,
        Sword,
        MagicBook,
        Sarbacane,
        Axe
    }

    private void OnEnable()
    {
        SetAttackBehavior();
        PlayerDamage.instance.weaponCooldown = weaponCooldown;
    }
short hazel
#

OnEnable for scriptable objects does not work in the same way as OnEnable for MonoBehaviour. It will get called when the SO is created, not when the game starts

atomic holly
#

Ahhhhh

#

Is there a way I can transfer the value of the SO to a monobehaviour when the game starts ?

short hazel
#

From the MonoBehaviour that uses the scriptable object, call OnEnable() (which you'll have to rename) from the MonoBehaviour's own Awake or OnEnable

slate haven
#

someone added me as a collaborator on git repo. Now I made a new branch and I want to upload updated Unity project folder/files on it. How do i add my updated repo folders and files into it?

short hazel
slate haven
short hazel
#

Are you using the command line, or some app to manage your local Git repository?

slate haven
short hazel
#

Well usually you should clone before you make any changes, and then you make the changes in the clone directly. That will catch the changes automatically. But yes if you have another copy of the files elsewhere, you can replace them in the cloned repo and they'll be tracked by Git

slate haven
long jacinth
long jacinth
#

navmesh is not moving

teal viper
long jacinth
teal viper
long jacinth
teal viper
#

Then maybe wait a few frames between setting it again. Anyways, there's no guarantee that it's the cause, so just try for now.

teal viper
#

Try calling it once only at start

long jacinth
#

is it wrong that i baked the floor the player and the enemy?

marble hemlock
#

this might be an odd thing to try to code but is there a way to basically script:
if anything falls below a certain y level, force it back up to a specific Y level?

#

im not worried about the player, but just in that case too, i dont want anything falling
i dont know exactly how to have a script tell everything its not allowed to fall below a certain point. I feel like I'd have to individually put that in each object that could possibly fall

#

ig it wouldnt be too difficult using prefabs, but just for future reference it would be nice

timber tide
#

is this using rigid bodies or the character controller

marble hemlock
#

for the things i pick up?

#

or my character?

timber tide
#

could just disable the gravity honestly and set the y when you drop the item

#

the items specifically

marble hemlock
#

oh well the player is controlled by the character controller but all the objects i pick up have a rigid body.

timber tide
#

Right, well modifying physics using rigidbodies is a pain. What you can do though is turn off rigidbodies when the y is of a certain height and recorrect it. But, I'd probably just use character controllers in this case if you do want to modify them.

#

this way you can ignore setting gravity on the character controller when it is of the certain height

marble hemlock
#

rigid bodies are cruel indeed

#

i might take a break because something completely unrelated broke too
When i hover over the pillars, i get the interact prompt, but the flashlight and cube are labeled the same way (Which gives me a debug log signifying that i should be seeing the interact prompt), but it gives me no prompt.

time to eat breakfast

ripe vigil
#

anyone know whats wrong i put the code in hastebin

rocky canyon
#

ignore my millions of gizmos

marble hemlock
#

i realized that i had set it to ignore collisions because i didnt want the player dragging everything along, (Which it does interact with the other object i try to pick up, which is... fine but i dont want them glitching objects through things because it got put in a weird spot), but i

rocky canyon
#

my player is a CC

marble hemlock
#

maybe i should have the objects kinematic until they pick it up and its dropped? but then id have to have it know when it hits the ground to set it back to kinematic

#

to prevent them from dragging things i mean

ripe vigil
#

what to do

marble hemlock
#

wait this shouldnt even be a problem if i finish the inventory system

#

i cant escape it

rocky canyon
rich adder
ripe vigil
rocky canyon
#

um i havent even looked but i can.

ripe vigil
#

thx

marble hemlock
#

cant do nonconvex and rigidbody together

#

UNITY WHY

ripe vigil
#

im new to coding i got no ide what going on

rocky canyon
marble hemlock
#

YOU'RE SUPPOSED TO BE ON MY SIDE catcrymic

rocky canyon
#

and ur code link didnt work

rocky canyon
#

make sure the end of it is jibberish..

#

../ahjeoud1283

ripe vigil
rocky canyon
#

eh that works

#

dont do that all the time tho.. mobile guys cant even see that..

#

makes em download it to their phone first

ripe vigil
#

u talking to me?

rocky canyon
#

yessir u posted code did u not?

ripe vigil
#

yes

#

ok

rocky canyon
#

anyway.. yea same answer

ripe vigil
rocky canyon
#

look at how u spell the one in update

#

and how u spell the one at the top

#

really carefully..

ripe vigil
#

im dumb

rocky canyon
#

no worries.. happens

#

misspellings are the bane of us all

rocky canyon
ripe vigil
#

thx

burnt vapor
#

If your editor was configured properly then you would not have these issues

eternal falconBOT
rocky canyon
#

bot thinking

ripe vigil
burnt vapor
ripe vigil
#

visual studio

burnt vapor
#

If it was configured properly it would inform you of your issue directly rather than having to check the Unity console

ripe vigil
#

wdym configured

burnt vapor
#

Click Visual Studio in the bot message and follow the steps

rocky canyon
burnt vapor
#

Click the one that suits you (if you installed Visual Studio through the Unity Hub you pick that one)

rocky canyon
#

and please when you do.. follow the directions to a T

muted anvil
#

Hello everyone, I'm trying to replicate the camera movements seen in the Windows 3D Viewer application. I've attached a video to show the behavior I'm aiming for. So far, I’ve only managed to get the 3D model to rotate horizontally on its own axis, but I can't achieve the desired camera movements or vertical motion without the model doing a full rotation. I’ve also attached a video and the code I’m using. When I try to add vertical movement, the model ends up twisting and moving erratically. The model's pivot is already centered. I would greatly appreciate any help or suggestions to resolve this issue. Thanks in advance!

Code: https://paste.ofcode.org/39m6K3XRztYBqRk4ruGJL24

rich adder
#

also looking at your code, you should never multiply mouse inputs by Time.deltaTime.

golden ermine
#

I have this script thats on ingredient that will drop after killing enemy, player will pickup ingredient and when he goes to another scene it will add up to amount of ingredients he had with ingredients he collected in another scene but problem is for example I have ingredient called Rotten Egg and in inspector under string name I write "Rotten Egg" as it is put in inventory script but when I play the game and ingredient is being instantiated it will have "RottenEgg" in inspector which is incorrect. Can someone pls help. Here is code:

rich adder
toxic cloak
#

hello is it normal for screentoworld point of mouse position to detect mouse in scene in playmode

golden ermine
#

Value should be Rotten Egg and I put it like that in prefab @rich adder

#

but when its spawns in scene it will say RottenEgg instead of Rotten Egg

rich adder
golden ermine
#

prefab, btw Im gonna use Zombie Brain for now thats also ingredient

#

spawned in game

#

inspector

rich adder
toxic cloak
golden ermine
rich adder
toxic cloak
#

is there any function in unity to prevent the detection outside the game view

rich adder
rich adder
golden ermine
toxic cloak
topaz rain
#

Hi!
I'm getting some weird behavior.
I have a reference to one script. I have serialized the variable and referenced it through the inspector.
How ever, when I access it I get a working reference and a null reference at the same time.

I mean, i get to communicate with the script but I get a null reference error at the same time.

Any idea about whats happening here?

rich adder
topaz rain
slender nymph
#

for clarification, they mean another copy of the component in the scene, not another copy of the script in your assets folder

topaz rain
slender nymph
#

you didn't use the t: to search by type so it's searching by name

topaz rain
slender nymph
#

and make sure to do the search at runtime when you see the Null logs in the console

muted anvil
rich adder
topaz rain
#

Also, idk, im asking for a vars value, not for objects with the component, so even if there are other objects with the component, my var should be referencing the one I've linked throigh the inspector right?

slender nymph
# muted anvil why?

mouse input is already framerate independent, and that's the purpose of the deltaTime multiplication. so by multiplying mouse input by deltaTime you end up with stuttery camera controls

rich adder
slender nymph
rich adder
#

also would pass this inside Debug.log

#

Debug.Log(musicManager, this)
(this lets you click the log and it should highlight the object)

topaz rain
#

ok guys got it

#

is not the music manager which is duplicated

#

but the menu controller

#

ty so much

#

i was going crazy

slender nymph
#

for future reference, don't just print single values. print actual log statements that make the logs actually distinct

rich adder
#

happens to all of us 😛

slender nymph
#

like instead of Debug.Log(musicManager); you should instead do something like Debug.Log($"{name} has {musicManager} assigned as music manager");

rich adder
#

i always cram name in there somewhere

topaz rain
fervent abyss
#

does anybody know any UnityEvents alternatives that can serialize parameters in Inspector