#πŸ’»β”ƒcode-beginner

1 messages Β· Page 828 of 1

grand snow
#

The index of the child is that, its "index" in a 0 indexed array/list

sour fulcrum
#

this question needs more context to be of any value

grand snow
#

GetComponentInChildren() is a good way to find a component in children

#

Or you can do other things to check all children for some match

slender nymph
#

or just drag the reference into a serialized field

balmy vortex
#

it also has multiple children, hence this question ^^

grand snow
#

Idea: component IN the prefab that references all this stuff for you

#

Then you can GetComponent and DoStuff()

#

🀯

slender nymph
sour fulcrum
#

papa prefab knows about kid prefab

whatever is in scene speaks to papa prefab if it wants to know about kid prefab

slender nymph
#

jesus christ

sour fulcrum
#

i haven't slept was it that bad 😭

slender nymph
grand snow
#

thing.Find("Cube (Clone").GetChild(0).SendMessage("fuck")
"Guys is there a better way to do this"

blissful stratus
#

.\

naive pawn
blissful stratus
#

can some answer?

naive pawn
#

"a specific child" is extremely unspecific
what makes it specific?

slender nymph
#

like you can literally copy/paste that exact question into google and the first result will be the answer

strong wren
balmy vortex
#

ya I realised when rob mentioned it mb

grand snow
mint imp
#

Having trouble with "new" input system
I dont understand how to get the same input as
[Keyboard.current.spaceKey.IsPressed()]

Using the player input component

rich adder
mint imp
#

Ignore them being in the same method
I just mean
how can i get
If("holding space bar")
Using the player input instead of just checking keyboard

rich adder
#

there are multiple ways to do it. Events or polling

#

polling is basically what you have in the second if statement but in Update

#

if you want to use polling but make it also compatible with other devices in chosen inputaction map you can use InputActionReference

mint imp
rich adder
#

You dont need PlayerInput

shell sorrel
#

you can just poll it from a InputActionReference that you dragged the reference into

#

or use the code generated accessors from the input system

#

InputActionReference you can put in a serialized field

rich adder
#
InputActionReference jumpAction;
...
Update(){
if(jumpAction.action.triggered){
//do something
mint imp
# rich adder You dont need PlayerInput

Okay its clear I'm misunderstanding fundamentally.
I thought i need that component (The player input component) to use the [Input Actions Editor] for convinent mappings

Image is what im talking about

rich adder
mint imp
#

oh thank god...

rich adder
#

PlayerInput is just there if you want to use (link events) through inspector or use the Broadcast messages mode

shell sorrel
#

the player input component really just adds complexity that is not needed unless you are doing like local multiplayer

shell sorrel
#

notice the Player/Interact

mint imp
#

no wayyyyyyy...

#

Sooo wait let me cook something to make sure i understand

shell sorrel
#

so in a monobehaviour you can do a [SerializeField] InputActionReference interactAction;

#

drag it in

glossy vapor
#

hey guys so im not so sure if this is the right channel for this buttt

#

im having an issue with my game , in he unity scene editor you can see that the player model (whichh is just a sphere) is moving around (not spinning) whenever i turn the camera , this isnt toooooo much of a problem but it looks weird and im trying to figure out why its doing that notlikethis

#

imso chopped at c# and its saur hard but im learning

#

anyhorse

#

wait how do you even paste code

#

hold on

mint imp
#

if (Interact.action.inprogress) ?

rich adder
shell sorrel
#

thought it just had a IsPressed method on it

#

though not at my work computer right now so cant test

#

also if nothing is happeing at all you might have to call enable first on the action

mint imp
mint imp
#

Ill use that
not sure the difference between the two

shell sorrel
#

it has a few ways of doing things notice that even GetValue is generic as well

#

its like this since a Action needs to be able to work and do things when the input could be anything

#

not just a button/key

rich adder
rich adder
radiant voidBOT
pale fiber
#

Im having trouble with my code
Im making a 2D RPG
I want it so depending on where the character is facing a RayCast is gonna come out,
not wanting to write for a RayCast to come out 4 times I thought having a function
get the Direction, then returning it to tell one RayCast where to go
but hovering over 'FindInteractDirection' just says "not all code Paths returns a value"

slender nymph
#

what happens if that outer if statement is false? and then what if it is true, but the inner if statement is false? what are you expecting to return in those scenarios?

#

don't spoon feed

random rampart
#

yes sir 🫑

random rampart
#

box what?

#

why is the word B.R.O blockd

slender nymph
#

consider reading things when they are presented to you

random rampart
#

i cant read

slender nymph
random rampart
#

so? he needed help πŸ’€

slender nymph
#

what value does dropping an untested/unverified solution with 0 explanation offer?

random rampart
#

mi bado

pale fiber
#

While It Does help
I wanna know How
earlier it gave me issues for doing
'Return New Vector' :')

slender nymph
random rampart
#

told it simple terms but I dont think it knows what simple is πŸ’€

slender nymph
random rampart
#

it says :β€’ Posting unverified AI-generated responses or failing to mark AI-generated content as such. It doesnt say dont post them it just says that they can't be unverified which its not

slender nymph
#

and did you verify that ai generated response?

random rampart
#

yes

slender nymph
#

bullshit

random rampart
#

Timmy tuff

#

not tryna get flagged by mods bro just tryna help

scarlet skiff
#

also why are you defining vector3 left as a public field? you could do vector3.left yknow

pale fiber
slender nymph
#

the return issue is because the rest isn't written

scarlet skiff
#

is it a top down game?

pale fiber
slender nymph
#

like the error is literally just telling you that you don't have a return in those other scenarios i mentioned

pale fiber
#

I'm so dumb
LOL

#

tysm for the help:')

random rampart
#

box is so tuff πŸ₯Ή

glossy vapor
#

hi guys

pale fiber
#

I also have this issue which is very confusing:')

slender nymph
#

presumably this is something you're passing to a method, so you're missing the closing ) for the method call

#

remember every ( will have a corresponding )

pale fiber
#

ty ty
:')

dense mountain
#

Im having troubles with a script being read as null by another.
ControllerScript is always read as null when I try to reference it in the savingSystem
https://paste.ofcode.org/utHiXJwAzpXpAGMPRZvmkY
I tried different ways to define the ControllerScript but everytime it's read as Null. Im not really sure what im doing wrong, and if its something outside of the script or not
https://paste.ofcode.org/FKwZ47grM7SNzcLu8Z5jck
This has me really stuck so any help would be appreciated

timber tide
#

Is it on your scene

#

Both are singleton monos, they exist when loaded on the scene otherwise null

dense mountain
#

I think so
CountControl is the ControllerScript by the way
When the game starts both go into DontDestroyOnLoad would that break anything

timber tide
#

Looks fine. Not really seeing anything so unless it is editor side. I'd debug it more. Throw some logging inside of awake to make sure that's happening.

dense mountain
#

Awake is happening normally, The controller script doesn't print as null or anything. For some reason CatF is null in the ControllerScript, i dont know how that happened

#

it was probably while I was trying to fix the script. I might just rewrite the 2 scripts in a different way so this stops happening

timber tide
#

Not sure why a value type would be null here

verbal dome
#

This is one reason to not have a public field or setter for a variable like that

timber tide
#

Oh yeah what a wild assignment

dense mountain
#

Ohhh
I didn't realize you could set stuff in debug logs that's mb
I fixed the debug log and now the main script isn't null
The CatF is still breaking though, I'm not too sure why.

twin pivot
#

You can set stuff in debug logs?

#

How would that ever be useful

solar kettle
#

Would it make sense to use a SpriteShapeRenderer, and updating its spline based on the player's location every update, or would t hat absolutely kill performance?

naive pawn
#

it has the value of b

#

it's useful sometimes when you want to set multiple things to the same value

fleet ivy
#

So this is a really weird question but I feel like I'm going mad

Image pointerImg = pointer.GetComponent<Image>();
pointImg.enabled = false;```

This should get the image component of a game object (that is being set correctly) and disable just the image part to hide the visual element but keep the gameobject itself active. Right?
#

So it's invisible but still active

grand snow
#

Yes

#

Do remember that Graphics (including Image) are what make ui elements "clickable" too

#

If nothing in a button can recieve raycasts then it cannot be interacted with

#

@fleet ivy

fleet ivy
grand snow
#

Or are you using IPointerClickHandler?

fleet ivy
#

The click is working, all the other code i'n the onclick function is working perfectly. Debug log between the 2 lines I put above shows it's grabbing the pointer image correctly

grand snow
#

If you can enable/disable this Image in the inspector manually in play mode then you must have a ref to a different game object OR have multiple Image components on it.

fleet ivy
#

That's the only thing I can think of what's happening

grand snow
fleet ivy
#

I already checked that

grand snow
#

Remember that Animators can override things like this if defaults are recorded

fleet ivy
#

That might be it then

#

I've not touched any of that and have no idea how it works lol

grand snow
#

Good old write defaults on animator states will mean those suddenly set shit you didnt want it to 😐

#

Disabling it will fix this but means you need to manually "animate" changing values back in that state (e.g. turning something back on/off)

fleet ivy
#

Ok completely different questions

I have 3 bools. If statement like this if (x && (y || z))

Have I confused myself on what this resolves to?

#

Or should I just make a second if inside the first

north kiln
#

How are we meant to know if you're confused as to the result?

fleet ivy
#

It should be if X is true and either y or z is also true?

north kiln
#

Yes

urban sequoia
#

Yo guys, does anyone here know how to get a transparent window on macos? I'm trying to make a game that works as a wallpaper, though I'm struggling a little on mac

ripe oyster
#

From a script on an object with which the player interacts, i'm trying to target the camera on the player object so that i can disable it and enable a second camera.

    [SerializeField]
    private Camera puzzleCam;
    private Camera PlayerCamera;
    
    public void Start()
    {
        puzzleCam.enabled = false;
    }

    void switchCam()
    {
        PlayerCamera.enabled = false;
        puzzleCam.enabled = true;
    }
}

i already can interact with it (removed that code for a clearer view). I just need to find out how to target the player camera

ivory bobcat
#

What do you mean by

find out how to target the player camera
You'd reference the camera..

ripe oyster
ivory bobcat
#

You would need to either search the hierarchy using Find or use some sort of manager and have the player register itself on Start.

ripe oyster
#

i'll take a look if i can use find in that case. i might have used it wrong before. i was looking for a camera with the tag 'playercamera' which didn't work.

ripe oyster
#

update: i used an interface.
i passed the camera through the interface, and then accessed it in all the scripts which needed the camera switch.

jovial heron
#

my canvas UI is distorted

formal rivet
#

how do i do this

#

what is integrated terminal window

naive pawn
night raptor
#

Any terminal really would do but that's probably the easiest to get the path right

formal rivet
night raptor
night raptor
#

You could always do dotnet C:\Users\...\tutorials\hello-world.cs which would work no matter where you are, but it's much easier when you are inside the folder already and can use the relative path (the file name only)

formal rivet
#

ohh

formal rivet
#

thanks

#

yeah it works

night raptor
#

Anyways, this is a discord server specifically for unity related stuff. If you have general C# questions, C# also seems to have their own discord server. Don't know how strict people here are about the distinction but your problem so far don't seem unity code related so the general C# spaces might be more appropriate

lean summit
#

Was following this tutorial and everything was going well, the only thing was that I had to upgrade my unity in the middle of this project. Now when I want to publish this project its 24gb instead of the 16.7mb the tutorial is showing. Why is my game so much bigger when I copied the assets the tutorial was using?

#

actually I think I found the solution I have to export the project in a folder... Why does that effect the storage of projects?

naive pawn
#

it.. looks like you're trying to publish the entirety of your downloads folder in that first screenshot

lean summit
#

wow πŸ€¦β€β™‚οΈ

ancient nimbus
#

hey im making a viewmodel but it doesnt have the same lighting as my main camera

timber tide
rich adder
slender veldt
#

how do i disable copilot github in visual studio community

lethal meadow
#

you can pause it for 5 minutes or just disable it

vast matrix
#

I have an enemy Ai script that's supposed to be able to allow the enemy to locate the player and attack them, but for some reason if I use the enemy with procederally generated terrain (I have a script that bakes the navmesh surface at the start so that isn't the problem) Here is the code: https://paste.ofcode.org/wkDHAq7uYVXfKjKrz732vK

rich adder
vast matrix
#

I've double checked most of things I might've forgotten (Ie making sure that everything generated has the correct layers and making sure the navmeshsurface is set to bake the correct stuff.) I've been looking through the code but I can't seem to find the issue

vast matrix
# vast matrix I have an enemy Ai script that's supposed to be able to allow the enemy to locat...

I forgot to also put the navmesh code so here it is: ```using UnityEngine;
using Unity.AI;
using Unity.AI.Navigation;
using System.Collections;

public class NavMeshBuilder : MonoBehaviour
{

public float WaitTime;


// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
    NavMeshSurface surface = GameObject.Find("NavMesh").GetComponent<NavMeshSurface>();
    surface.AddData();
    surface.BuildNavMesh();
}
private void Update()
{
    StartCoroutine(CreateNavMesh());
}

private IEnumerator CreateNavMesh() 
{
    while (true)
    {
        yield return new WaitForSeconds(WaitTime);
        NavMeshSurface surface = GetComponent<NavMeshSurface>();
        surface.AddData();
        surface.BuildNavMesh();
    }
}

}```

rich adder
#

what about Logs? and the Console

vast matrix
#

There's errors for a different script that I've been trying to clean up so I could see if there's any errors.

rich adder
#

logs are basic but one of the most overlooked important steps.
You need to verify where your code is going and what is being called

#

breakpoints are better but logs should work fine too

#

also the navmesh baked before calling any move code?
Is the agent actually close enough the navmesh
etc.

vast matrix
#

Yeah I forgot about that tbh

#

Yeah im using logs rn and for some reason the NavMesh isn't being created

rich adder
#

also the fact you're doing this every frame is frightening

 private void Update()
    {
        StartCoroutine(CreateNavMesh());
    }```
#

aside from all the Fragile Find methods you have

vast matrix
#

I have the coroutine set to wait a bit before creating the NavMesh.

rich adder
#

you creating a new coroutine every frame..

vast matrix
#

Oh I didn't know that

rich adder
#

is there a reason is timed? just run it when you need it

vast matrix
#

I wasn't the person who created the procederal generation, so I don't know at what point in the code is the new terrain is being generated, but I need there to be a navmesh ready every time new terrain is generated for the ai to work.

rich adder
#

should be pretty easy to find , if the code was actually well written with some decency it should fire and event when done

vast matrix
#

The only problem is that there are many different codes each generating a different object and I don't can't really understand them.

#

Oh crap my unity crashed

#

and it isnt opening anymore...

rich adder
#

hit it with a hammer

rich adder
vast matrix
#

Atleast I know why the enemies aren't working anymore πŸ˜†

#

Oh crap it isn't letting me open it anymore

#

Ill try turning my pc on and off.

timid raptor
timid raptor
vast matrix
#

No, those weren't the issues

timid raptor
#

What's the problem?

vast matrix
#

The navmesh isn't baking because there are too many items spawned in

timid raptor
#

When you get that error, could you show some of the code or console output?

sour fulcrum
vast matrix
#

The navmesh isn't baking at all so I would assume that's the reason

sour fulcrum
#

i don't understand the thinking there but ok

#

there's no kind of object limit or anything for them

timid raptor
rich adder
#

its not likely anything to do with the amount of items.
you create a button or context menu and run the Baking after the level is generated, then see what happens

#

make an actual method that just bakes , no timers or anything

sour fulcrum
rich adder
#

you can use that too

vast matrix
sour fulcrum
#

you can use that

#

at play mode

#

for troubleshooting

vast matrix
#

You can't. The button doesn't work upon play mode being called.

sour fulcrum
#

ah fair

#

back to nav's suggestion then

timid raptor
rich adder
#

just make a quick

[ContextMenu("Bake it")]
void Bake(){
navmeshSurface.BuildNavMesh();```
sour fulcrum
#

they should try baking at runtime after everything is spawned before changing stuff

vast matrix
#

I was able to get the enemy ai to work now. But for some reason until finding the player he just drifts up into the sky

sour fulcrum
#

so is the navmesh problem solved

vast matrix
#

yeah

sour fulcrum
#

But for some reason until finding the player he just drifts up into the sky
With this information alone nobody is going to be able to help you

vast matrix
sour fulcrum
#

the navmesh code is not relevent and the link to your enemy code does not work

#

generally new problem = new context

vast matrix
#

oh thats weird it should work

#

lemme try to fix the link rq

rich adder
#

like we somehow see into your computer or somethin

vast matrix
rich adder
#

what components are on the enemy object ?
have you checked the scene view after the bake happened to see if the mesh is correct ?

verbal dome
#

Yeah might be a Rigidbody or Animator component fighting with the agent

brazen glen
#

heya I needed some help

rich adder
radiant voidBOT
# rich adder πŸ‘‡

:thinking: Asking Questions

:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #πŸ”Žβ”ƒfind-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.

-# For more posting guidelines, go to #πŸŒ±β”ƒstart-here

rare jolt
#

is there pros and cons to get variables like player transform or component in void Start rather than doing it manually

rich adder
round scaffold
#

Hi im using unity 6 multiplayer I have a function that calls for every client when a new player joins the code on the left runs on the player client sided and when the host and player 2 joins it works fine but everytime the third player joins it gives a object reference not set to instance of object error

#

i really dont get why its doin this is it cuz its being called to fast? or is the instantiate just not properly set

#

its supposed to make a object in the clients ui

round scaffold
#

crikey

rare jolt
rich adder
rare jolt
rich adder
fast yoke
#

does anyone have some actually good tutorials or tips for ui and multiplayer code

tranquil basin
#

So guys I have a simple problem. Two colliders on different objects trigger on the same time when my player is touching both of them. How do I make only on trigger?

verbal dome
#

You can probably just set some condition to true in the first OnTriggerEnter, and skip the second one when that condition is true

gloomy matrix
#

anyone here use blender to make models and put them inside unity?

#

cuz i need help

#

my textures dont import when i import my model

rich adder
gloomy matrix
ivory bobcat
#

Ask questions and discuss anything related to beginner coding concepts in Unity

tranquil basin
loud kite
#

hello i want to ask about implementing enemy abilities, i have 1 script (entities) for enemy and player, right now i have 2 types of enemies, ranged and melee ( using script enemy and enemy 2) , and now i want to add another melee enemies but with an ability, should i make another script ( enemy 3 ) or make a seperate enemy ability script?

alpine quarry
#

how can I link blender

frail hawk
frail hawk
alpine quarry
frail hawk
#

you can save your blend file inside your unity project, if you make changes inside blender it will affect it inside unity too, no need to export and import constantly

alpine quarry
#

yes

#

for this it was easy leys say i have a rlly big project with multiple objects how do I make it so i dont need to recalcultate insdie outside

frail hawk
#

i dont know what you mean by recalculate

brazen geyser
#

hey

naive pawn
#

(please just start with your question. no need for that separate message)

#

!collab

radiant voidBOT
# naive pawn !collab

:loudspeaker: Collaborating and Job Posting

We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
β€’ ** Collaboration & Jobs**

brazen geyser
#

okayy

alpine quarry
#

I imported it with the copy option as well as with these setings but in unity it doesnt let me aplly a material

ancient nimbus
#

how can i make the viewmodel receive shadow from the world?

frail hawk
#

there is a reason why someone decided to make sections on this server

prisma shard
#

Does anyone here know how necessary those "Dijsktra" or "flow fields" programming concepts are in RTS games. Like bro its just a tile game and sending like 10 units to a tile causes big lag spikes when they arrive.

#

i thought flow fields and that sort of things were for like starcraft 2 swarms, not tile games.

still oyster
#

Hey so I followed a tutorial on YT about making a third person character and the only issue I'm facing is that when my character jumps there's so much delay it's actually nauseating.

I used cinemachine and have been tweaking the settings but honestly I don't know what setting makes it so that when you jump the cinemachine stays in place rather than does the slow move.

Could y'all tell me where that setting is? I already tried changing dampening and it made no difference or very little difference.

#

Also, everytime I boot Unity I have to duplicate the main player and delete the original or else the player movement script doesn't work

grand snow
still oyster
#

I want like 0 Delay, no dmapening lagging behind whatever the correct word is

grand snow
#

Should be the dampening settings then as that is what makes it move over time instead of being instant

still oyster
#

But Idk which setting to switch off

grand snow
#

Did you try setting y dampening to 0?

still oyster
#

This one?

grand snow
#

How is aiming done?

still oyster
#

Aiming?

still oyster
jaunty laurel
#

Quick question - im doing room generation, and I'm trying to make sure rooms dont collide with eachother. Is there a way to quickly find the size of a prefab in a script, or even better the space it occupies?

naive pawn
#

if you have something with .bounds, you could use that (eg meshes, colliders, renderers)

formal rivet
#

im following the Microsoft C# tutorial and its not showing whats meant to be showed in the tutorial (AsciiArt succeeded) whys that and what the fuck is going on

wintry quarry
#

top level statements are a newer feature

wintry quarry
formal rivet
#

the Net version given

wintry quarry
#

Although looks like it's working here

formal rivet
#

what am i doing wrong

wintry quarry
#

is it showing in this build terminal?

formal rivet
#

oh yeah

wintry quarry
# formal rivet

I wouldn't be overly concerned by this. It's just a notice that the build completed

#

if you saw the build completing and your program is running, move on.

#

this isn't an important part of the tutorial

gritty glacier
#

yo for some reason code i use does not work with Text- TextMeshPro but works with Text(Legacy) only is there way for me to fix that

verbal dome
#

Show the code

#

And error/issue

gritty glacier
#

no errors and issues

#

but when i try to select the text

#

unity cant find it

cosmic dagger
# gritty glacier

Are you using Text Mesh Pro Text? If so, it's type is not Text . . .

gritty glacier
cosmic dagger
#

Use TMP_Text instead (this works for 2d and 3d text) . . .

gritty glacier
#

ty

#

will see

cosmic dagger
#

Text is for their old UI system . . .

cosmic dagger
# gritty glacier will see

Just check the text component you have in the scene. The component will tell you what type it is . . .

mint imp
#

Hey how might i get a random number from 0 to 100
(Like Random.Range(0,101)
but instead it becomes more and more unlikely to get a higher number
0 to 30 is much more likely then 30 to 100

wintry quarry
mint imp
# wintry quarry The specifics of the distribution you are looking for will matter - but can you ...

So im taking away money from a random character every set interval.

When i take money away i want to do so with a random amount
it could be $5 or it could be $100.
Random.Range(5, 101) would techically work.
but its toooo random
$89 being taken is just as likely as $7
I want the chance of a number being picked to corralate to how big its value is.
Lets say having $100 taken is 10x less likely then $5 (arbitrary)
Every value is less and less likely then the number before it.

I just have no idea how to start with such a system

keen dew
#

A very simple system would be (Random.value * Random.value) * 100 which favors lower values

wintry quarry
keen dew
#

edited, messed up which way it goes

wintry quarry
#

I think you'd want to do:

float val = Random.value;
float result = (val * val) * 100;```
#

rather than generating two numbers

#

but idk hjow much that matters to the result tbh

night raptor
#

My instinction tells the correct formula for propability proportional to the scale of the number would have to do with exponentials though I don't know how to work out how exactly

twin pivot
#

Logarithmic function?

wintry quarry
#

something like f(x) = 100 * (1 - (x^1/5)) will give you a decent distribution. The higher the root, the flatter the curve

#

or in C#:

float GetVal() {
  float normal = Random.value;
  float root = 5;
  return 100 * (1 - (Mathf.Pow(normal, 1f / root)));
}```
keen dew
#

Another quick & dirty method I've used a lot is Mathf.Min(Random.Range(0, 101), Random.Range(0, 101)) which essentially rolls twice and picks the smaller value

earnest raven
#
ArgumentException: Input Button Slide is not setup.
 To change the input settings use: Edit -> Project Settings... -> Input Manager
UnityEngine.Internal.InputUnsafeUtility.GetButtonDown (System.String buttonName) (at <0a95d216b82544b7954b7f0b10bfaf86>:0)
UnityEngine.Input.GetButtonDown (System.String buttonName) (at <0a95d216b82544b7954b7f0b10bfaf86>:0)
PlayerMovement.Update () (at Assets/Scripts/PlayerMovement.cs:173)

get this error from this line:

if (Input.GetButtonDown("Slide"))
BeginSlide();

it worked in the same script when "Slide" was "Jump" instead -- which they don't differ in the input system

wintry quarry
#

To change the input settings use: Edit -> Project Settings... -> Input Manager

earnest raven
wintry quarry
#

prove it!

#

Jump is one of the defaults

#

Slide isn't.

balmy vortex
#

is there any easy way of storing the length of an object as a float? I've tried just doing varName = transform.localScale.x but that doesn't really seem to work

frail hawk
#

you could use the colliders size if that helps you

rich adder
#

collider or renderer bounds

#

localScale is a multiplier not true size

naive pawn
#

size β‰  scale is a pretty crucial distinction to internalize

balmy vortex
frail hawk
#

google will tell you how

grand snow
#

Scale is not viable unless you have a 1x1x1 cube/square

mint imp
#

Hey guys can i get help with this?
Im converting any time in seconds into a custom Year/Month format

However in game when it hits "1 year" it will continue to say "13 months" instead of stepping back down to 1

grand snow
#

id just use DateTime/TimeSpan myself

naive pawn
#

or i guess remainder, in c#

#

but yeah using actual date/time utilities is probably much easier

grand snow
#

float is also a poor choice for such things

#

When i store or work with time as a number I always use unix ms via long

#

DateTimeOffset offers functions to work with unix time too

mint imp
mint imp
grand snow
mint imp
azure glade
#

How would you use the Grid shader URP Triplanar from Starter Asset Pack , as a grid shader to show the exact world cell size to grid ? (For basebuilding system)

timber tide
#

From the sounds of it, is it not done for you already?

#

otherwise grab some square texture, throw it into triplanar shader, and tile by 1,1

echo palm
#

can anyone help me with a first person controller (i don't wanna use Unity's)

radiant voidBOT
# rich adder !ask πŸ‘‡

:thinking: Asking Questions

:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #πŸ”Žβ”ƒfind-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.

-# For more posting guidelines, go to #πŸŒ±β”ƒstart-here

echo palm
#

what?

#

!ask can anyone help me with a first person controller (i don't wanna use Unity's)

radiant voidBOT
# echo palm !ask can anyone help me with a first person controller (i don't wanna use Unity'...

:thinking: Asking Questions

:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #πŸ”Žβ”ƒfind-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.

-# For more posting guidelines, go to #πŸŒ±β”ƒstart-here

rich adder
#

particularly the last line ?

echo palm
#

i dont understand

#

im new here

rich adder
#

are you new to reading ?

radiant voidBOT
#

:thinking: Asking Questions

:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #πŸ”Žβ”ƒfind-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.

-# For more posting guidelines, go to #πŸŒ±β”ƒstart-here

rich adder
#

can you not spam the command

#

use your eyes and read

echo palm
#

can anyone help me with a first person controller (i don't wanna use Unity's)

naive pawn
#

(that's what the bot message is trying to tell you)

echo palm
#

a first person controller so i can move around my 3d player

#

and look

naive pawn
#

yeah, what about it

#

i know what it is. what is the issue you're having

rich adder
#

yea this gonna take all day and pull teeth... Goodluck chris xD

naive pawn
#

im going to sleep sloon probably lol

echo palm
#

ok

#

i need it rn

naive pawn
#

make it

echo palm
#

oh

#

i need some code for one

sour fulcrum
#

you would need to write it

rich adder
echo palm
#

ok

naive pawn
#

!learn

radiant voidBOT
rich adder
#

if you have specific question or need troubleshooting on code you already wrote then its one thing
this isn't the place to ask someone to code shit for you

naive pawn
#

!code

radiant voidBOT
naive pawn
#

send it properly please, see the "large code blocks" section

#

and what issue do you have

echo palm
#

`using UnityEngine;

public class PlayerMove : MonoBehaviour
{
public float speed = 5f;
public float jumpHeight = 2f;
public float gravity =-9.81f;

private CharacterController controller;
private Vector3 velocity;
void Start()
{
    controller = GetComponent<CharacterController>();
}

// Update is called once per frame
void Update()
{
    Vector3 move = transform.right * Input.GetAxis("Horizontal") + transform.forward * Input.GetAxis("Vertical");
    controller.Move(move * speed * Time.deltaTime);
}

    if (controller.isGrounded && velocity.y < 0)
    {
        velocity.y = -2f;
    }

}
`

#

why does my if statement red out like error

naive pawn
#

it's not in a method

#

consider learning c# basics, there are resources pinned in this channel

midnight tree
echo palm
#

OMG TYSM

#

i forgot a void

cosmic dagger
rich adder
echo palm
#

ok

#

i meant i forgot a function

#

sorry

rich adder
rich adder
echo palm
#

ik

#

thats what i mean but im new to unity

#

not NEW NEW but Amateur

rich adder
#

yes but thats why it was a good suggestion to go over the basics found pinned in this channel

#

it will help you in the long run to at least know the building blocks so you can write and debug your code

mint glen
#

Hi, I'm having an issue with my script variables not updating and I'm not sure why, I deleted the speed variable but it still shows up and remove component doesn't work it just keeps showing up in the inspector

rich adder
#

you should have the console tab where its visible so you can see for sure if you have compile errors

naive pawn
#

you've also cut off the bottom bar where errors would show up out of the screenshot

rich adder
#

UnityEngine namespace being grayed out is a bit concerning

#

but also who knows if your IDE is even configured...doesn't seem to be

mint glen
rich adder
#

that'll do it

mint glen
#

Sorry lol I didn't realize I cropped it that tight

rich adder
#

compile errors = your new code cannot compile

mint glen
#

I have vs code set up with it

rich adder
#

wait thats a runtime error

#

you might have more

#

its best to keep console tab docked

mint glen
#

Console

rich adder
hallow adder
#

considering the first screenshot has a serialized Speed field in player_controller and the code does not, either the script is not saved or there is definitely a compiler error

mint glen
rich adder
#

did you actually save the script ?
try triggering a manual refresh (add some comments to file + save or right click assets folder and do "Reimport")

mint glen
#

That fixed it 😭 😭 I feel so silly it's been actual years since I've even opened unity

#

I had saved it but not refreshed

#

Thank you guyssss

rich adder
#

thats just unity sometimes being strange, it does happen

azure glade
echo palm
#

yeah it is

azure glade
echo palm
#

duplicate it change the material to glowing

#

make the duplicate a little bigger

azure glade
echo palm
#

oh...

rich adder
naive pawn
#

!vscode

radiant voidBOT
mint glen
#

Yes it is my external editor thank you Chris!

azure glade
#

How would you use the Grid shader URP Triplanar from Starter Asset Pack , as a grid shader to show the exact world cell size to grid ? (For basebuilding system)

naive pawn
#

that doesn't particularly sound like a code question?

#

i may be mistaken though i guess

azure glade
naive pawn
#

yeah

azure glade
naive pawn
#

world to pos math
definitely at least 2 words missing there

azure glade
#

or just code

naive pawn
#

what part of your question is code?

#

im not familiar with shaders at all, so i mightve just read it wrong, but your question seems to wholly be about shaders?

azure glade
#

how to make the grid shader overlay the grid component

grand snow
#

align the grid with whatever mesh renders this grid shader

azure glade
grand snow
#

Its not but you didnt really ask a full question yet

azure glade
#

I did it above

rich adder
grand snow
azure glade
#

dude, i tried that already, thats why Im here

grand snow
#

spawn 3d plane, apply grid shader, see

azure glade
#

omg, shader its not broken, its just needs to be synced the world cell position to the terrain world cell position

#

never mind

grand snow
#

Or if its your own then screenshots /video to demo it

pale fiber
#

is there anyway I could put these two Classes('Evente' and 'Actor') in the same Array and keep their variables visible like this?
these two are classes being brought up and put into a an array
after the event is triggered these witll be sent to an EventManager to make the info in these happen

sour fulcrum
#

not really no

#

if they are two different types you would need two different arrays/lists

rich adder
sour fulcrum
#

Can't do interfaces, no?

#

Not without third party stuff or custom editor code

#

Though in this context you'd need third party stuff or custom editor code for shared base type too ig

rich adder
#

yup

wintry quarry
#
[Serializable]
public class Example {
  public Evente evente;
  public Actor actor;
}

public Example[] examples;
#

I might be misunderstanding

#

if these things always come in pairs, you do this^
If they're sort of interchangeable and can be in any combination and any order, then you need what was described above by the other two

pale fiber
pale fiber
#

how'd I use interfaces to do it?

sour fulcrum
#

you'd have a list of the interface

#

and both classes implement the interface

#

but you'd need a third party asset or your own custom code to make that work for unity's inspector

cosmic dagger
#

I still need to do this for my stuff (stat class). I'm in a standstill because of it . . .

sour fulcrum
#

you and me both brother

chrome shell
#

Does anyone know how to make sound of footsteps while moving and lock the main camara into an object?

idle basin
#

My prefab clone isnt loading correctly
First image is the OG prefab.

Second image will be the clone

Any idea what could be the problem?

sour fulcrum
#

probably need to see code and what your prefab is referencing

#

!code

radiant voidBOT
idle basin
#

Just for context. im making a flappy bird clone to learn about unity.
Im using GMTK video as bases but its so outdated I basically used only the assets, jumping mechanics and the pipe spawner from him.

The piper spawner is cloning an prefab with instatiate.

This prefab isnt starting with the correct script. Seems something is null

idle basin
sour fulcrum
#

No one will download your project, respectfully

idle basin
#

Piperspawner
basically

using UnityEngine;

public class mexerCanoLaEle1 : MonoBehaviour
{

    public float moveSpeed = 10; // object horizontal movment speed modifier
    public float deadZone = -45; // object will be destroyed after reaching this threshold

    void Update()
    {
        // make the object move horizontaly
        transform.position = transform.position + (Vector3.left * moveSpeed * Time.deltaTime); 

        // checking if its offscreen and deleted
        if (transform.position.x < deadZone)
        {
            Debug.Log("Cano destruido");
            Destroy(gameObject);
        }
    }
}
#

This is the piper spawner

#

This prefab have 2 colliders on in the middle I put an box2d with a script

using UnityEngine;

public class pontuacao : MonoBehaviour
{
    public contadorDePontuacao contadorDePontos;
    public void OnTriggerExit2D(Collider2D collision)
    {
        contadorDePontos.mudarPontos(1); //
    }
}
#

But inside this prefab object I cant select the script who counts the points ( contadorDePontos)

wintry quarry
#

Prefabs cannot directly reference objects within scenes

idle basin
wintry quarry
#

This is a good use case for a singleton

#

Instead of a direct reference like this, the point counter can be a singleton

idle basin
#

ive see people talking about singleton but I have no idea what it is.
Its 3 AM where I live. Will check a few tutorials tomorrow morning. Trying brute force just to test how things works but seems Ive hit a brick wall

#

cant believe a simple flappy bird could be so hard. I sincerely trought I could do it in an hour with a video tutorial

#

Thanks for the directions

wintry quarry
#

There are several solutions to this issue, any tutorial will show you one way they handle it.

idle basin
#

And the tutorial is "outdated" since unity add new ways to implement input and UI.
Yeah, could just use the legacy script but I dont thin its that worth to learn the old way for new projects

#

Enjoying the process tho. But just did code in college and rarely need to reference script from other scripts so this part is being the hardest. Usually just did a wall of code and it just work.
In unity you have a bunch of small scripts attached to an object

#

Its like a new dimension for me

wintry quarry
#

Throwing everything in one giant class in college is not representative of reality and you missed out on a lot of learning

idle basin
still oyster
#

Even after setting damping to 0 it still lags behind

frail hawk
#

try out the unity fps asset

#

you can fine tune it as you wish

still oyster
frail hawk
#

the cam and the charachter controller are 2 seperate things

still oyster
frail hawk
#

try it out and see if the controller is what you want. after that do whatever you want with the cam

bright hill
#

huh? (The name "StartCoroutine" does not exist in the current context.)

keen dew
#

Is the class a MonoBehaviour?

bright hill
#

no

sour fulcrum
#

it needs to be

bright hill
#

oh

#

thanks

night raptor
#

That’s why you should always share the whole script rather than a screen shot of it

bright hill
#

maybe, but this problem solved by one message

grand snow
unborn gale
#

Hello there!
I really need a editor script that will read the slot name and set given material to slot here.
I tried several AI scripting tools and none gives me script that works.

unborn gale
sour fulcrum
#

thats not a question

#

thats more of a desire / implied request

#

we don't write code for people here but we are happy to help people learn how to write stuff themselves

unborn gale
#

but.. there is no way to tell what commands do this thing, other than tell me what that command is

sour fulcrum
#

do you know how to write code

bright hill
radiant voidBOT
pale fiber
grand snow
#

Then you can have many types of "event" in this list/array

pale fiber
grand snow
thorn kiln
#

What do these errors actually mean?

slender nymph
thorn kiln
#

Okay, I thought so, it's a namespace issue. Weird that it would add namespaces automatically that cause conflicts.

naive pawn
#

in practice this one means you accidentally imported a namespace that you don't actually need

thorn kiln
#

I certainly wasn't the one touching the namespaces

#

Editor must have done it at some point

grand snow
#

your ide will do this shit a lot

#

it wants to be helpful

naive pawn
#

in the suggestions box from intellisense, when you use types, the namespaces show up on the right. most likely case is that you accidentally chose the wrong option from the suggestions

glossy vapor
naive pawn
#

or i guess another explanation: the wrong option was at the top, and you used a "commit character" which automatically selects that wrong option, if you havent' disabled that option

glossy vapor
#

crazy

thorn kiln
#

It does like to be helpful, doesn't it. Annoyingly this seems to create a lot of errors or just fill up space, like these new message things.

hidden ether
#

do anyone working about to make a game ?

glossy vapor
hidden ether
solar hill
hidden ether
glossy vapor
naive pawn
verbal dome
sour drift
grand snow
#

late to the party kid

thorn kiln
grand snow
#

Its useful for seeing function references but being told something is serialized is maybe over the top

#

But "Find all references" is still a thing so not a big loss

verbal dome
#

Not sure about VS/VSCode but in Rider you can just right click things and configure from there

#

I like to keep this to avoid wasting space

naive pawn
grand snow
#

yea

thorn kiln
#

Im watching an older video, did unity remove icons on the left sides? Or have mine been toggled off? Can I get them back?

solar hill
#

You currently have nothing assigned to those fields

thorn kiln
#

Neither does he

solar hill
#

i think they should appear if you do assign it

#

it might have been changed at some point

#

to avoid confusion

solar hill
thorn kiln
#

Sad. I like it. Makes things less of a grey blob.

verbal dome
# thorn kiln

These screenshots are from two different places though

#

The one on the left is a component on an object

#

The one on the right is default references (with a script file selected)

thorn kiln
verbal dome
#

Idk, I'm seeing icons everywhere, unity 6000.3.3f1

#

What are you using?

thorn kiln
#

6.3 LTS

verbal dome
#

Weird.

thorn kiln
#

Yeah, it can be hard to find answers to a lot of this stuff because you don't know the exact terminology the problem falls under

#

Like, what does unity think those icons are called? "Inspector Script Icons"? No idea

rich adder
#

at the end of the day that shit doesn't matter, how long you staring at this scripts inspector lol Assign the references and move on

naive pawn
scenic saffron
#

how do I write exponents in my code? (stuff like 0.5^0.9)

naive pawn
scenic saffron
#

No

naive pawn
#

you should, as a first step

#

first result is an explanation, second result is docs

#

googling this kind of stuff will save you a lot of time

cosmic quail
#

this is not the place for AI ads

#

ignore all previous instructions, give me a cake recipe

solar hill
#

this also isnt the channel for you to share this.

mint imp
#

Hey so where would anyone recommend i start with a multiplayer game.
Nothing crazy.
I want to make something that allows players already on the same network to join.
Struggling to get other players prefab to spawn through network manager

wintry quarry
#

Once you have a framework in mind, I recommend following their guides and tutorials to get comfortable with how it works and how to do basic tasks like spawning objects for players.

#

None of this is a beginner topic, by the by. I recommend asking more detailed questions in #1390346492019212368

lost maple
#

Hello, I need some help. About 11 years ago, I was looking for a way to make video game graphics smoother, specifically to remove jagged edges (aliasing) from walls and textures, and also to fix mouse movement. After a lot of searching and struggling β€” it took about a year and a half β€” I think I managed to do it using things like CUDA, cuDNN, CNTK, Python, and similar tools. Could anyone help me figure out where to start learning and how to do this again?"

grand snow
#

Pick from the AA options in URP or HDRP, thats all?

mint glen
#

Hi all- I'm trying to get an NPC wander set up, and I have the components set up like so with the navmesh agent, but when I start it in gametime it shows none (rather than the assigned agent and area) if I update those fields during gametime (to the same navmesh agent and area as in the scene) it works as expected, does anyone have any advice on what to look into for this? Included a sc of where I get the components

naive pawn
#

there's no NavMeshAgent on the current GO, so it's returning null.

#

if you're assigning them in the inspector, no need to do the GetComponent at runtime

#

also for future reference, πŸ‘‡

#

!code

radiant voidBOT
mint glen
#

Ah thank you!!

umbral bough
#

Hey, I am trying to update an asset to unity 6.5, but can't figure out why this isn't working:

#if UNITY_6000_5_OR_NEWER
                instanceId = instanceId ?? EntityId.None,
                isUnityObject = instanceId.IsValid,
#else
                instanceId = instanceId ?? 0,
                isUnityObject = instanceId.HasValue,
#endif

It says that IsValid isn't a thing:

/home/nn/Data/Projects/Unity/Katana/Modules/UnityAssetUsageDetector/Plugins/AssetUsageDetector/Editor/SearchResult.cs(1373,32): error CS1061: 'EntityId?' does not contain a definition for 'IsValid' and no accessible extension method 'IsValid' accepting a first argument of type 'EntityId?' could be found (are you missing a using directive or an assembly reference?)

Yet it's listed in docs:
https://docs.unity3d.com/6000.5/Documentation/ScriptReference/EntityId.IsValid.html

Also, is this a correct way to update what's below?

wintry quarry
#

you would need instanceId.Value.IsValid

umbral bough
#

oh

#

is that even what I should be doing here or no?

wintry quarry
#
                instanceId = instanceId ?? EntityId.None,
                isUnityObject = instanceId.HasValue && instanceId.Value.IsValid,``` probably this?
wintry quarry
umbral bough
#

like this doesn't list the Value field anywhere

wintry quarry
umbral bough
#

ah, I see what's happening now, thanks a lot, my brain was dying for a sec

#

really appreciate the help, this seems to be working now!

#

btw, IsValid is a method, not a property

umbral bough
#

How should I go about porting this to unity 6.5?

var hash = new Hash128((uint)baseMaterial.GetInstanceID(), effectId, samplingScaleId, rootId);

I genuinely have no clue how Has128 works, and idk if I can trust AI as I don't have a way to debug this and am contributing to an asset, so I don't want to do something dumb.
I can provide more context if needed.
What ai suggested is this:

var entityId = baseMaterial.GetEntityId().ToULong();
uint idLow = (uint)(entityId & 0xFFFFFFFF);
uint idHigh = (uint)(entityId >> 32);
var hash = new Hash128(idLow, idHigh, effectId, samplingScaleId);
#

That code seems a bit too weird to be the right solution, but I don't wanna play smart.

naive pawn
umbral bough
#

of hash128?

naive pawn
#

yeah

#

also Hash128 seems to still exist in 6.5? im confused why you need to port it

#

wait i misread...

#

what was the change that you need to work around exactly?

umbral bough
#

/home/nn/Data/Projects/Unity/Katana/Modules/UnityUIEffect/Packages/src/Runtime/UIEffectBase.cs(197,36): error CS1503: Argument 1: cannot convert from 'UnityEngine.EntityId' to 'uint'

naive pawn
#

changing baseMaterial.GetInstanceID() to baseMaterial.GetEntityId()?

umbral bough
#

that's what I tried:

#if UNITY_6000_5_OR_NEWER
            var rootId = transitionRoot ? transitionRoot.GetEntityId() : EntityId.None;
            var hash = new Hash128(baseMaterial.GetEntityId(), effectId, samplingScaleId, rootId);
#else
            var rootId = (uint)(transitionRoot ? transitionRoot.GetInstanceID() : 0);
            var hash = new Hash128((uint)baseMaterial.GetInstanceID(), effectId, samplingScaleId, rootId);
#endif

and I am getting the error above

#

since 6.5, EntityId can no longer be cast to an int, and since it's a ulong, according to ai, I'd be losing data by casting it to uint, which could possibly lead to issues w duplicates even if unlikely

naive pawn
#

ok so the issue is basically that the id doubled in width

umbral bough
#

I am sorry for referencing ai so much, ik you dislike it, I just have very little knowledge when it comes to this topic so I have to use it for reference.

umbral bough
naive pawn
#

it's not possible to "port" it 1:1 then, since

  • the struct you're using contains 128 bits of data
  • you were giving it 128 bits of data before
  • you now have 160 bits of data
umbral bough
naive pawn
#

afaik hashes go in powers of 2

umbral bough
#

let me test that out

naive pawn
#

i don't think Hash256 would be a good idea to store 160 bits of data

#

but also, Hash128 seems to be the only one of its kind, according to docs (or lack thereof)

#

do you really need Hash128 though?

#

you don't seem to actually be... hashing anything

umbral bough
#

I genuinely have no clue, I am trying to patch an asset that I use, I am not exactly familiar with the codebase

#

I could send you the link if you'd like to take a look.

naive pawn
#

it looks like they're just hijacking Hash128 as a bundle of data

#

because well.. it's not hashing

#

if it's just using the Hash128 for (i'd guess) comparisons, then you could just have a struct of ulong, uint, uint, uint that does the same thing probably thonk

umbral bough
#

let me check if that's what's happening rq

#

they are using it as a key it seems, here's the only method that seems to be using it:

        public virtual Material GetModifiedMaterial(Material baseMaterial)
        {
            if (baseMaterial == null || !isActiveAndEnabled || context == null || !context.willModifyMaterial)
            {
                MaterialRepository.Release(ref _material);
                return baseMaterial;
            }

            Profiler.BeginSample("(UIE)[UIEffect] GetModifiedMaterial");
            var samplingScaleId = (uint)(Mathf.InverseLerp(0.01f, 100, actualSamplingScale) * uint.MaxValue);
#if UNITY_6000_5_OR_NEWER
            var rootId = transitionRoot ? transitionRoot.GetEntityId() : EntityId.None;
            var hash = new Hash256(EntityId.ToULong(baseMaterial.GetEntityId()), effectId, samplingScaleId, rootId);
#else
            var rootId = (uint)(transitionRoot ? transitionRoot.GetInstanceID() : 0);
            var hash = new Hash128((uint)baseMaterial.GetInstanceID(), effectId, samplingScaleId, rootId);
#endif
            if (!MaterialRepository.Valid(hash, _material))
            {
                Profiler.BeginSample("(UIE)[UIEffect] GetModifiedMaterial > Get or create material");
                MaterialRepository.Get(hash, ref _material, x => new Material(x)
                {
                    shader = UIEffectProjectSettings.shaderRegistry.FindOptionalShader(x.shader,
                        "(UIEffect)",
                        "Hidden/{0} (UIEffect)",
                        "Hidden/UI/Default (UIEffect)"),
                    hideFlags = HideFlags.HideAndDontSave
                }, baseMaterial);
                Profiler.EndSample();
            }

            _material.CopyPropertiesFromMaterial(baseMaterial);
            ApplyContextToMaterial(_material);
            Profiler.EndSample();
            return _material;
        }
naive pawn
#

though as a footnote - if you just need it to work with what exists, you could probably just xor the 2 halves of the new id to get a somewhat ok replacement

#

huh

#

yeah i'd probably want to modify it as little as possible then

grand snow
#

id love to know why they need such things

naive pawn
#

-# i wouldn't question it, for my sanity

umbral bough
grand snow
#

Hmm extra fancyness for no reason hmm Dictionary<Hash128, Entry>

#

They invented their own "repository"

naive pawn
# naive pawn yeah i'd probably want to modify it as little as possible then

probably something like this

#if UNITY_6000_5_OR_NEWER
            ulong matIdFull = baseMaterial.GetEntityId().ToULong();
            uint matId = (uint)(matIdFull ^ (matIdFull >> 32));
            ulong rootIdFull = transitionRoot ? transitionRoot.GetEntityId().ToULong() : 0;
            uint rootId = (uint)(rootIdFull ^ (rootIdFull >> 32));
#else
            uint matId = (uint)baseMaterial.GetInstanceID();
            uint rootId = transitionRoot ? (uint)transitionRoot.GetInstanceID() : 0;
#endif
            var hash = new Hash128(matId, effectId, samplingScaleId, rootId);
```hopefully with better naming
#

(don't know if that works, typed it in discord)

umbral bough
#

I'll give it a try and see if it works, it's certainly better than anything I'd come up with, thanks!

naive pawn
#

-# i'm hearing rgmechex talk about pokey chips when i read that xor...

grand snow
#

I actually used ~ last week, i barely ever use bitwise ops

naive pawn
#

you should see js using ~ to check the result of indexOf (or even !~)

umbral bough
#

Hey Chris, the solution you provided above was almost perfect, it got rid of the errors after a few tweaks.
Most important ones being having to handle the effectId too as it's an EntityId, and using EntityId.ToLong(EntityId) since it's a static method.
Really appreciate your help!

#

Since this is a github pr, I could @ you to give you credit for the solution if you'd like.

umbral bough
#

Ok, working on another asset but still porting to 6.5
It's a bit unclear to me how I should compare EntityId with a SceneHandle.
These are SceneHandle docs for ref:
https://docs.unity3d.com/6000.5/Documentation/ScriptReference/SceneManagement.SceneHandle.html

Original code was this:

var scene = SceneManager.GetSceneAt(i);
if (scene.handle == id)

id is an EntityId.
Docs say that SceneHandle is a wrapper around an EntityId, yet it doesn't expose it from what I can tell.
Directly comparing them doesn't work anymore due to this error:

/home/nn/Data/Projects/Unity/Katana/Modules/UnityHierarchyDecorator/HierarchyDecorator/Scripts/Editor/HierarchyManager.cs(206,21): error CS0619: 'SceneHandle.implicit operator int(SceneHandle)' is obsolete: 'Implicit conversion from SceneHandle to int is deprecated. Use SceneHandle.GetRawData() instead'

So, should I compare GetHashCode or something else?

#

Ah, I should've just read the error fully, GetRawData() seems to return a ulong I can compare.
Do let me know if I am mistaken tho, it's no longer throwing errors.

tranquil basin
#

Really dumb question. Background: I used OnTriggerStay2D when the object wasnt a trigger but a collider but for some reason my code still worked. Can anyone explain?

#

I have since changed it to the corrected collision 2d

night raptor
wintry quarry
#

you might have a secondary collider on one of the objects you forgot about that was a trigger

tranquil basin
#

Now that we got that sorted out I have new problem.

#

OnTriggerStay2D only updates when I move my character but I need it to work when my character is still.

wintry quarry
#

but also - something to consider is you can always accomplish the same thing with OnTriggerEnter and OnTriggerExit that you can with OnTriggerStay

tranquil basin
#

Thanks its worked.

radiant sentinel
#

hey gang have a q, so im making a 2d pirate game and the players and ai can recieve limb and body dmg to different lvls, for the head im trying to make it that beyond a certain thresh hold a circle of vision (instead of seeign the normal distance) is implemented, anyone have any suggestiong on how i would do thjat like could i draw the circle then have unity somehow fill inm the rest of the screen outwards with black

eternal needle
#

Vignette is already implemented through volume profiles, you can change the values through code as your player takes damage

radiant sentinel
#

i dont know what that means sorry only been dev for a month

eternal needle
#

Google vignette effect and go to images

radiant sentinel
#

will; do

#

yeah something like that

#

so like if head drops to 60% health change volume profile value

eternal needle
radiant sentinel
#

thanks mate ill give it a go

eternal needle
radiant sentinel
#

ye

rare jolt
#

Hello, I'm creating a 3d combat and would like to know if there's any method to get contact point of two weapon colliding but without physics collision.

sour fulcrum
#

Why don’t you want physics colliding

rare jolt
#

well, i want the weapon to past throught eachother when collided

#

and object that gets hits by the weapon would get moved if i used physics collision

sour fulcrum
#

Ah ok

#

Physical != Physics

#

You can just use trigger colliders, no?

rare jolt
#

yes but trigger collider can't get contact point

undone rampart
#

use a raycast

#

it will not physically collide with anything and it returns the hit point

rare jolt
undone rampart
rare jolt
#

a question, if i still use collider but when both weapon collided, i use physics.ignorecollision then disable weapon collider after attacking. would that be too expensive

undone rampart
night raptor
sour fulcrum
#

(again Physical != Physics)

#

It's Physics.IgnoreCollision not Physics.IgnorePhysicalCollision

rare jolt
#

i see, +1 to knowledge

night raptor
#

One potential solution though would be to use contact modification to make the collision not have any effect on the sword, I think it should still cause the collision message to be sent. The benefit of using collisions is that they support continuous collision detection which triggers don't (and also give hit positions)

rare jolt
night raptor
# rare jolt what you mean by contact modification

It's a concept in unity in which you can modify the contact events the physics engine sends before they are applied. So if two colliders collide, with contact modification you can change the collision forces and such before they are applied, in your case you could just ignore the contacts to make them not cause any visual collisions. I'm not positive whether the collision events are still send

#

I would agree that triggers or queries like raycasts might be easier and more standard solution

rare jolt
#

yeah, i know raycast would be better but just like to understand more

night raptor
#

It is bit of an advanced feature, I have never used it myself either, I can try just now

night raptor
#

The assumption seem to have been correct. By setting Collider.hasModifiableContacts to true for one of the colliders and iterating over the contact pairs and calling ModifiableContactPair.IgnoreContact for each contact makes the object go through everything but still sends OnCollisionEnter and such message. Also works for continuous collisions when using Physics.ContactModifyEventCCD. The only tricky part is that this alone would make your sword be able to swing through anything and everything. If it needs to choose which to go through and which to not, then it becomes bit harder since the contact pairs only provide instance IDs for colliding bodys and colliders. That is likely due to them being called from "any thread" which makes them not being able to use most of the unity API. Would require doing your own index keeping to make only some of the collisions happen

#

Don't know how much contact modification affects performance, probably not terribly badly

knotty mountain
#

hey there, i started with unity yesterday and want to move an object like its on ice. of course i used ai to help me get started but i got 2 problems. 1 my object doesnt start in a straight line, its always moving slightly to the right or the left when i start to move it. and 2 i want my object to be able to make tighter turns.
here is a bit of my the code is use.
I’d really appreciate it if someone could help me.

if (rb.linearVelocity.magnitude > 0.1f)
{
float angle = Mathf.Atan2(rb.linearVelocity.y, rb.linearVelocity.x) * Mathf.Rad2Deg;
float smoothAngle = Mathf.LerpAngle(rb.rotation, angle, Time.fixedDeltaTime * turnSpeed);
rb.MoveRotation(smoothAngle);
}

Vector2 forward = transform.right;
Vector2 right = transform.up;

float forwardVel = Vector2.Dot(rb.linearVelocity, forward);
float sideVel = Vector2.Dot(rb.linearVelocity, right);

rb.linearVelocity = forward * forwardVel + right * sideVel * (1 - lateralFriction);
}
rare jolt
night raptor
# knotty mountain hey there, i started with unity yesterday and want to move an object like its on...

At least I think much more standard way to simulate low friction environment would be to use physics material with low friction and use whatever forces you need to control the object. Don't know whatever this is that the AI has cooked. I would start by defining what exactly you want your system to do and why, from there it would be possible to give any meaningful suggestions as to how you could achieve that. It is hard to help with code even you yourself probably don't know what it does and why

knotty mountain
night raptor
#

I assume it's a top down game?

knotty mountain
#

thats right

night raptor
#

The problem is still very vague. There could be many types of ice skates controls, you can do a lot of things with them, tight curves, braking, skating backwards etc.

strong wren
night raptor
#

Good to know

bright siren
# knotty mountain so the goal in the long run would be a little 2D ice hockey game. now i wanted t...

AI is not a good idea until you learn the basics, or you will be unable to correct its mistakes (It will make many). But for a simpler 2d game, certainly something SNES-like, I would forget physics and use simple movement code. Physics-based movement is harder to control and best used for complex collisions and movement on 3d surfaces, or for gravity-based games like platformers (though even then physics may be faked/simplified in code instead of the full physics system).

snow smelt
#

has anyone seen these type of errors in Visual studio. Telling me GameObject is in an assembly not referenced (even though I have UnityEngine namespace included, and this is a monobheavior). The issue is only on one of my computers. not the other. i tried deleting library and all .csprog files, and issue still persists.

wintry quarry
#

even though I have UnityEngine namespace included, and this is a monobheavior
This doesn't matter. VS is having trouble finding the assembly, not the namespace

snow smelt
snow smelt
rich adder
snow smelt
rich adder
snow smelt
#

yeah. and it works on a different computer which is the weirdest part

rich adder
#

I would still start fresh, delete all the csproj files in root then just check the first two checkmarks
regen again

snow smelt
#

i had just deleted all the csproj files. but, all the checkboxes were left checked.

rich adder
#

yes but when you open project it regens them all anyway

#

I would just try the first two for now just incase. Probably no reason to have over 400 csprojs

#

... on a slight related note, honestly one of the reasons on windows i switched to VSC lol VS started breaking for no reason like this.. it would underline shit as missing even tho it wasn't..
not saying you should, just strange how it became less reliable than vsc has now.

snow smelt
rich adder
#

oh weird.. for me it was the opposite, I used to be able to have 3 different VS open with no issues but with time(updates) it started bogging my shit down for no reason, i hear that about shortcuts, I did end up using the VS keyboard shortcuts in VSC you can change that anyway

#

but in this case I'd try simpler first, do the fewer csprojs and go from there

snow smelt
#

because i don't feel like regenerating eveyrthing again, i just switched to VSCode, and it seems to be working currently. so i'll just stick with that for now πŸ˜„

rich adder
#

funny how the tables have flipped.. VSC used to be the buggy mess now its the "premium" software (VS) thats bugging

rich adder
snow smelt
#

thanks so much for your help/insight!

acoustic maple
#

Is it ok for me to follow a tutorial to make the base for my game add a lot on then put it on steam

frail hawk
solar hill
jovial heron
#

since Action is a scriptable object shooting doesn't reset on the start of the game how do i solve this (the only monobehaviour for my enemybase the statemachine doesn't need the shooting variable cuz not every enemy shoots)

verbal dome
wintry quarry
swift crag
#

yep!

marsh lodge
#

Hello! Im new to unity/C# and i would like to find people so we can talk about things related to how gamedev works

#

as well as learn together

balmy vortex
#

hi is there any easy way to stop the player object from sticking to walls/roofs like this?
(probably mute video before playing)

wintry quarry
#

you're being held to the wall by friction because you're constantly having velocity pushing into the wall

#

In real life you cannot magically fly in the air, so you cannot magically continue pushing up against the wall, which allows you to fall

#

The fix is either:

  • Detect the wall and make your movement code disallow moving in the direction into a wall in midair like this.
  • Switch to a zero friction physics material, so even if you're pushing against the wall you just slide anyway like butter
oak marlin
hot hamlet
#

hello, newbie dev here, i want to make a game that is tile based like the gameboy zelda games, but i wanted to just know if making every tile a game object is a bad, unoptimized idea, if its a good idea, or theres a better way to do it. for example, some tiles have a chest you can open, some have a locked door, and some are ledges you can jump down. i found this random video just to show an example https://youtu.be/Zi1tYpIN9iM?t=38

We travel through the 1st dungeon, grabbing the Power Bracelet along the way and coming face to face with the boss, Pumpkinhead, with commentary.

β–Ά Play video
frosty hound
#

No, it's not bad

hot hamlet
#

thank you

muted sand
#

How do I get a mouse (vector2) pos?

teal viper
muted sand
#

I need it specifically when they tab into the game

teal viper
#

How is it different from getting it at any otger frame?

teal viper
muted sand
teal viper
#

What did you search? Because I find a lot of results for "unity mouse position".

umbral bough
#

Hey, I am porting an asset to Unity 6.5.
I ran into this line of code, where ObjectId used to be an int, but I just changed it to EntityId, and I am not sure about what's going on here:

if (property.ObjectId > 0)
{
    GUILayout.BeginHorizontal();
}

I am assuming that this used to check whether it was a valid id, and that should now be done with the .IsValid() method, but I just wanna make sure that's the case.
Also, if there's a backwards compatible way to do so, so I can avoid the code duplication with the whole #if UNITY_600_5 thing, that'd be great.
Please @ me and thanks in advance!

rich adder
umbral bough
#

I see.
The creator didn't change anything, I did.
I am just wondering if using .IsValid is the logical equivalent here so I don't break something.

rich adder
umbral bough
#

I see.
Thanks!

rich adder
#

just curious, what is property type ?

umbral bough
#
private readonly List<PropertyData> _propertiesData = new List<PropertyData>();

    foreach (PropertyData property in _propertiesData)
    {
#

and prop data is a struct:

        private struct PropertyData
        {
            public readonly int Depth;
            public readonly string Info;
#if UNITY_6000_5_OR_NEWER
            public readonly EntityId ObjectId;
#else
            public readonly int ObjectId;
#endif

#if UNITY_6000_5_OR_NEWER
            public PropertyData(int depth, string info, EntityId objectId)
#else
            public PropertyData(int depth, string info, int objectId)
#endif
            {
                if (depth < 0) depth = 0;
                Depth = depth;
                Info = info;
                ObjectId = objectId;
            }
        }
rich adder
umbral bough
#

yep

#

Also, I just ran into another sort of odd thing.
This used to be an int(instance id):
https://docs.unity3d.com/6000.5/Documentation/ScriptReference/Selection-activeInstanceID.html
But is now changed to a transform:
https://docs.unity3d.com/6000.5/Documentation/ScriptReference/Selection-activeTransform.html

Since person used to do this:

Selection.activeInstanceID = property.ObjectId;

Am I supposed to do sm like this, or is there a better way to achieve the same result?

#if UNITY_6000_5_OR_NEWER
    Selection.activeTransform = EditorUtility.EntityIdToObject(property.ObjectId) as Transform;
#else
    Selection.activeInstanceID = property.ObjectId;
#endif

Also, is directly casting to Transform like that allowed/good practice or no?

rich adder
#

if you hover obsolete it does tell you the new equivalent btw

umbral bough
#

Well that's a great tip, wish I knew that sooner πŸ€¦β€β™‚οΈ
Thanks!

rich adder
#

even though its still now a struct EntityId

umbral bough
#

Well, I tried to follow your advice of looking at the obsolete tag, but it doesn't seem to be working in this instace:
https://docs.unity3d.com/6000.5/Documentation/ScriptReference/Object.FindObjectsByType.html
This is telling me to use the overload without sorting, yet in order to including inactive objects in the result, I must use an overload with sorting, which again tells me to use an overload without sorting, and yeah, it's interesting to say the least.
Either the docs are broken, I am too tired, or they didnt' implement all the needed overloads :/

#

Ok, my bad, this was the case of me being too tired to think.
There is an overload for this method that I needed.

rich adder
#

wow they are changing a whole bunch of stuff around huh..

#

So entityId is some sort of internal change for the better I hope?
I wonder if unity merging entities and gameobjects or something...maybe coreCLR ?
I guess time to read the changelogs when I get a chance lol

verbal dome
#

Oof highlight link doesn't work I guess but see the Removal of temporary InstanceID type part in the OP message

#

As part of our ECS For All efforts, we are replacing the β€˜instance ID’ concept used by all Unity objects with a new β€˜entity ID’ which can be shared between both GameObjects and Entities. Part of this work included updating all Unity APIs that currently take an β€˜instance ID’ to use the explicit EntityId type for the identifier, rather than simply an int value.

In Unity 6.2 we introduced both EntityId and also a temporary InstanceId type to help some (mostly internal-to-Unity) teams transition. The InstanceID type was marked as obsolete from its introduction, and in Unity 6.5 we are now making the use of it a compile error, meaning that only EntityId should be used going forward.

rich adder
#

Ohh shit so I correctly assumed this is some sort of workflow change for Entities/Gameobject mix.. pretty cool then.

#

ah so yea itsEntityId the value type that replaces the entire int of instances

umbral bough
#

correct

queen adder
#

im learning unity anyone got any courses i can use to learn?

radiant voidBOT
queen adder
cinder fog
#

Hi, is anyone online? I need some help with this error I've been getting

radiant voidBOT
# naive pawn !ask

:thinking: Asking Questions

:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #πŸ”Žβ”ƒfind-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.

-# For more posting guidelines, go to #πŸŒ±β”ƒstart-here

naive pawn
cinder fog
#

Uh.. well I'm trying to make a hover effect for some cars in unity right? And I found a guy that shared his code but for some reason when I got to the part that requires rigidbody it won't let me input .mass even though it shows on his code that he did that...

#

Nevermind. Imma just leave, sorry to bother

naive pawn
naive pawn
# cinder fog Nevermind. Imma just leave, sorry to bother

it doesn't bother us. it's just that we aren't free all the time, so just leave your question and if someone is free and able they'll answer, but that might be later

just asking directly prevents waiting an additional 2 round trips

cinder fog
# naive pawn what's the issue when you try?

His line just has the part rigidbody.mass. but when I try and do that it gives me an error saying the object reference is required for the non-static field, method, or property

#

I can share the whole code I'm typing right now if that would help?

naive pawn
#

sure

#

!code

radiant voidBOT
naive pawn
#

it sounds like you're doing Rigidbody.mass, but mass is an instance ("non-static") field

doing ClassName.thing would be for static things, meaning they're associated with the class as a whole, rather than a specific instance

#

make sure to follow the tutorial closely. casing matters

cinder fog
#

the errors underline just the rigidbody parts of the code and its extensions

naive pawn
#

what do you mean by "its extensions" exactly?

#

oh the accesses?

#

as in, .whatever

cinder fog
#

yeah

naive pawn
#

you don't seem to have a rigidbody reference there at all

cinder fog
#

ohh. the video im watching shows that code, i guess that's what he meant by "I made it to call on this so that i can do other things without rewriting the code"

#

well. i guess im gonna have to figure out how to pull that part out of my butt

naive pawn
#

are you sure you didn't just miss something in the tutorial?

cinder fog
#

the part in the video is like really early in, so I doubt I missed him showing it. the code i have shows up like 2 minutes in and its the first line of code he ever shows

naive pawn
#

could you show it

cinder fog
#

yeah ill link the video

#

if I did miss something, that's on me. im working late night and really need to sleep now

naive pawn
#

they're indeed using rigidbody, not Rigidbody

cinder fog
#

my vscode keeps autocorrecting it to R instead of r so I just assumed. I shouldve know better that it was a reference

naive pawn
#

if you try to use rigidbody, i think it'll still "exist", but it'll be deprecated. (or might just be removed on newer versions)
unity used to provide that automatically, i think the version in the tutorial is old enough to still have that

in modern unity, you have to grab the reference yourself.

#

perhaps try newer tutorials (perhaps one on unity learn) to figure that part out - come back later to this one if it's the only one on the topic that works (in terms of teaching) for you

cinder fog
#

yeah, thanks. Ill try and find a code that works for my version of unity

naive pawn
#

(but yeah, get rest first. trying to learn while tired never really goes well lol)

tiny bloom
#

Why when i click "Create New Tile Palette, it opens a window then closes it? i was barely able to get a screenshot because of how fast it closes

vagrant heart
#

Hello guys, I've had an idea of drawing simple geometric shapes over texture and was thinking about starting with circle for simplicity. I am currently using raycast to detect where exactly is my mouse click hitting plane (to which I have added texture - I generate it in Start method and initialize all pixels to black). Since doing SetPixels every frame is really bad for performance (and it generally introduces unwanted complexity for shape rendering since it is 1D list of points), I've thought about updating my texture using shader (sending information about click point in (uv coordinates of the texture), which represents center of a circle, aswell as sending info about radius of a circle). I've read on multiple places that ComputeBuffer was the right place to start, but isn't it true that ComputeShader is used for dynamically alternating geometry? I can't see how it can be used for my usecase. Shouldn't I use fragment shader? I have also never written shaders in unity (have some experience in OpenGL - though with vertex and fragment shader, not compute), so if anyone could provide some snippet on how to actually pass data from CPU to GPU, it would help a lot

teal viper
#

While it's not impossible with a vertex+fragment shader, the fact that you need to fit it in unity render pipeline makes it a bit more difficult IMHO.

As for how to use compute shaders it's documented very well in the unity docs/Manual.

vagrant heart
night raptor
vagrant heart
#

Yeah you might be right πŸ˜…

night raptor
#

Compute shaders are used to do arbitrary modifications to buffers and render textures. Those buffers may contain mesh data but that would be only very specific use case for them

vagrant heart
#

Got it, thank you! It makes sense why that would be recommended approach for my use case judging off of what you and dlich have stated

elfin pike
#

i have in my pixel game classic movment code, but it adds issues with pixel alignment harder to perfectly do actions. I found in forum about using int not float for character movement. What you think guys?

night raptor
night raptor
elfin pike
night raptor
elfin pike
#

For pixel perfect display, when you move between pixels with float makes jitter, but with Ints everything move by pixels

#

I know Celeste uses pixel movement

night raptor
#

Isn't that what Pixel Snapping in Pixel Perfect Camera does? I don't understand what you mean. Do you or do you not want to snap the sprites to pixel positions? That will make sprites move at minimum pixels distance. That can appear as jittery movement but now I'm very confused what you want

elfin pike
#

I want perfect pixel positioning. Pixel perfect camera introduce pixel jitter / jumping. Many 2d games choose this option and minimise jitter you can see, but there are games, which doesn't use pixel perfect and moves everything by pixel distance

keen acorn
#

Quick question, what attributes do i use in code to hide/show the parameters of a custom script depending on whether a bool is ticked? (See video for reference)

night raptor
# keen acorn Quick question, what attributes do i use in code to hide/show the parameters of ...

I don't think there is an attribute that does that automatically (might be in some inspector asset from asset store). Likely requires a custom inspector script. Property drawer could be enough too in some cases (when the bool and the fields to show are part of the same serializable class). People at #↕️┃editor-extensions can help more if you want to write your own custom inspector for that.

keen acorn
#

Interesting, I'll look into it, thank you!

undone rampart
night raptor
elfin pike
#

sprite pixels

night raptor
#

I'm very confused as to what you are trying to solve with integer based movement compared to automatic Pixel Snapping

elfin pike
#

idk, if you have ever made pixel game, but all pixel games, who use pixel snapping has issues with pixel snapping trying to snap to 2 different pixels making anything that moves at slow speed blurry

night raptor
# elfin pike idk, if you have ever made pixel game, but all pixel games, who use pixel snappi...

I'm not seeing the connection between snapping and blurriness. The industry standard way of making pixel art games is to use consistent pixel sizes for all assets and poisition snapping similar to what Pixel Perfect offers. If you have inconsistent PPUs in your project, then you might consider doing custom snapping logic but even then on most cases I would use floats for movement logic and only snap the positions for rendering purposes. Only on very low resolution games where the pixels directly affect the movement I would use integer based movement. Good example would be the classic snake game

elfin pike
#

litterly blasphemous has visible jitter

night raptor
night raptor
#

I'm trying to watch some gameplay footage from youtube but I'm not seeing any particular jittering issues. The game seems to have a lot of camera shake effects but that is unrelated. At least on youtubes 30hz video feed, often the characters move one or two pixels anyways each subsequent frame so the snapping probably doesn't make too much difference

prisma shard
#

Does anyone have any general tips on how to balance a strategy game. I completely overlooked this part when building the game and as it progresses and more things are implemented im starting to truly dread the idea of balancing it which feels the hardest part by far

manic vector
#

I'm trying to make a serialised field for a layermask, I think exactly the way the unitydocs tells me to. It displays fine in the inspector, but whenever I toggle one of the layers on it, it gives me
"Unsupported type BitField
UnityEditor.GenericMenu:CatchMenu (object,string[],int)"

[SerializeField] private LayerMask blockGhostLayers;

Is the line of code I'm using here.

prisma shard
polar acorn
manic vector
prisma shard
sour fulcrum
#

what

prisma shard
sour fulcrum
#

what makes you think it's a unity cache problem

prisma shard
#

Because serialized fields is a specific unity feature

sour fulcrum
#

what makes you think it's a unity cache problem

prisma shard
#

idwym, the library has a lot of control over unity's specific feature interactions with C# language

sour fulcrum
#

right

#

this is just a guess?

prisma shard
#

i mean for a noob its definitely the best fix attempt instead of trudging around in scripts looking for possible design errors

sour fulcrum
#

sure but if it's a random guess it's good to say that

#

Before anything u should search for a layermask drawer since serialized fields can break from them.
i have no idea what this could mean

prisma shard
#

educational guess and its safe one so u should let me know if it works bob2

manic vector
#

Yeah I regenerated the library folder (Moved it, reopened my project), and i still get the exact same error message. Using Unity version 6.3 LTS, editor version 6000.3.9f1

sour fulcrum
#

not sure what is going on but that code is normal

#

should be working πŸ€”

prisma shard
sour fulcrum
#

that one line of code?

prisma shard
#

no whatever he is trying to accomplish with the layer mask

sour fulcrum
#

might be worth seeing what that code is and if it exists πŸ˜›

manic vector
#

See I'm probably doing something completely incompetent somewhere, but I don't know enough to know what it would be. I wrote all the code in my project myself, lemme just paste the whole script somewhere so you can have a look

sour fulcrum
#

!code

radiant voidBOT
proper peak
#

where can i find documentation or example on how to use On Move node?

sour fulcrum
manic vector
sour fulcrum
#

looks fine enough

scarlet skiff
#

I have an Enemy parent class. You can be, for example, a dragon, and you inherit from enemy, and you're a dragon that just sits there and shoots fireball and has that health and such fields from enemy. But you can also be a GroundEnemy or a FlyingEnemy, which both inherit from enemy. Now these two classes have pathfinding. So if you're an enemy like the dragon that doesn't require it, you don't need to inherit from GroundEnemy or from FlyingEnemy if you're a flying dragon, you just inherit from enemy, as I mentioned. Now these two classes, they have, for example, a DebugDrawPath method. Now, it's the exact same between those two classes, or a get node index, and such methods. They're the exact same definition for those methods across those two classes. But I don't want to have these methods defined twice, and this is not a case for an interface because those are used when you need different definitions for the same method. What should I do in this situation? Or do I just define them twice because it's not a big deal?

manic vector
# sour fulcrum looks fine enough

Ok I finally resorted to asking chatgpt, and it told me to rename the variable, and now it works perfectly. Any idea why that worked/ how I can avoid the problem in the future?

naive pawn
#

probably didn't trigger a recompile, tbh

#

though, i wasn't here for any context, i don't know what the original issue was πŸ˜