#💻┃code-beginner

1 messages · Page 389 of 1

slender nymph
#

there are beginner c# courses pinned in this channel. and since this is a unity server any answers you get here will likely be unity and c# focused

mortal obsidian
#

Yeah but any personal recommendations?

rich adder
#

imagine wanting to be gamedev but then throw yourself in javascript

slender nymph
#

if you want general game development advice for different engines/frameworks/languages then ask in a general game dev server

slender nymph
mortal obsidian
#

So people can use it more viably

slender nymph
rich adder
#

wtf

mortal obsidian
rich adder
#

seriously though why use JS

naive pawn
rich adder
slender nymph
rich adder
#

javascript performs like shit

mortal obsidian
#

U can make unity games on the web?

rich adder
#

Unity has Webgl format

#

yes

naive pawn
mortal obsidian
#

Oh good to know

slender nymph
mortal obsidian
#

U don't need js tho right?

rich adder
#

I used three.js for a quick portfolio site and wanted to shoot my hands off

mortal obsidian
eternal needle
rich adder
mortal obsidian
#

Alr alr

rich adder
mortal obsidian
#

For android? Does it use kotlin?

slender nymph
#

unity uses c#

rich adder
#

nope

summer stump
rich adder
#

it all gets compiled to hardware code anyway

mortal obsidian
summer stump
rich adder
#

You can use C# and Unity and Export to any platform (consoles too but you need special NDAs and approvals)

mortal obsidian
#

I asked for a recommendation based on experiences, since you guys know how to use unity

rich adder
#

check pins in this channel

#

lots of info there

mortal obsidian
#

Are they good tho?

slender nymph
#

why not find out for yourself

rich adder
#

You're not going to learn overnight of course, take a week to so play around and if its your thing then go for it.

mortal obsidian
#

Tbh I wanted to hurry, didn't wanna waste my time with wrong sources, that's why im asking ppl, regarding that, did any of u use the sources in question?

slender nymph
#

I wanted to hurry
yeah good luck with that

rich adder
#

^ very true . this is unrealistic

mortal obsidian
#

I meant, I want to start right away with the right source

slender nymph
#

if you can't even be bothered to put in any effort to research for yourself how do you expect to be able to "hurry" to learn an entire game engine

naive pawn
mortal obsidian
#

Like, for instance, with java I started with a book and had good results, I followed recommendations too

rich adder
#

if you know java then c# will be easy

mortal obsidian
rich adder
#

its essentially Microsoft Java.

mortal obsidian
#

Yeah

#

But is there an official unity guide everyone uses,??

slender nymph
rich adder
slender nymph
mortal obsidian
#

Alr, But did u guys learn from there???

rich adder
#

it mixes well Unity concepts into C#

slender nymph
#

i'm done engaging with this. this back and forth is useless since this person clearly wants to be spoon fed the information rather than putting in any amount of effort at thinking for themselves

summer stump
#

Why would they be pinned if they were not good?

mortal obsidian
naive pawn
mortal obsidian
naive pawn
#

do you trust 6 random strangers or an officially endorsed link on unity.com

naive pawn
rich adder
naive pawn
#

we aren't on craigslist, so we aren't trustworthy, end of discussion 👍

mortal obsidian
#

👌👌

rich adder
#

thought this was a field for those passionate in R&D

summer stump
slender nymph
#

i only use organically sourced courses from the stinkiest of brainrot farms. anything else is too complicated for my tiny brain to handle and is therefore misleading and worthless. if the course doesn't spoon feed me the information and give me step by step instructions without explaining the actual purpose of doing things a specific way then why even bother making it in the first place

late burrow
#

ok issue was i needed to provide base with parameters from parent class

#

but why i even need provide them if they not being used?

mortal obsidian
slender nymph
summer stump
late burrow
mortal obsidian
late burrow
#

whats the purpose of base

slender nymph
#

that calls the base class's constructor

rich adder
late burrow
#

but i dont want create first class i want create second class

summer stump
# late burrow

What is the purpose of doing this?
This is likely not what you want at ALL

late burrow
#

multiple of them for same parent

eternal needle
slender nymph
mortal obsidian
late burrow
#

but second not creates first one so why it needs parameters for first one

slender nymph
#

so when you create an instance of the second it is an instance of the first. and the first one can only be constructed using that parameterized constructor because that is the only constructor that exists on that base class

slender nymph
rich adder
mortal obsidian
#

XD I mean its roblox

late burrow
#

strange i debug logged and i havent seen duplicates

#

anyway can i have many of second classes all pointing to first class

rich adder
#

but this is going on too long, just try the material and make your own decision as with everything you should do in life. Goodluck friendo

slender nymph
slender nymph
late burrow
#

so i cannot have array of second class inside first class

slender nymph
#

why would you want that

naive pawn
late burrow
#

so i can store array of arrays in more sane way

slender nymph
#

that does not answer the question

naive pawn
late burrow
#

secondary class can hold variables and i can hold that class in array

naive pawn
#

yeah that's unrelated to inheritance

slender nymph
eternal needle
#

This went from an XY problem to an WXYZ problem

slender nymph
#

just an average interaction with anuked tbh

late burrow
#

because it will generate variables using ones from first class

slender nymph
#

that does not answer why it needs to inherit from it

stiff rock
#

hey, never had this happen, but when i loaded my project neither the game or scene was showing up with anything, how do i fix? i spent 10 years on this game !

naive pawn
naive pawn
slender nymph
stiff rock
eternal needle
naive pawn
stiff rock
slender nymph
eternal needle
#

Sounds like a corrupt scene file

stiff rock
summer stump
eternal needle
#

Ah modded game

eternal needle
#

We dont help with modding or decompiling

summer stump
#

Deleted a light?

slender nymph
# stiff rock see?

you've got lighting in the scene view enabled and what appears to be pretty much no lighting

summer stump
#

Oh, modded

stiff rock
rich adder
#

monkee game gonna be the new VRChat

slender nymph
#

it's also very clearly not showing "nothing" considering we can see the objects in the hierarchy and even the outline of the object selected

#

toggle this off and show what you see

stiff rock
#

yes i know but why does it have 0 lighting, not modded or anything its my game, just forgot my old acc, and had to undo it

#

nothing

eternal needle
#

Accounts have nothing to do with it.

stiff rock
slender nymph
#

i said show

mortal obsidian
stiff rock
#

it was working perfectly yesterday lol

rich adder
#

@tender stag as long as script on the same object as the PlayerInput asset it works without references.
So I just have 1 class that handles Inputs by making a public Get bool for example. Basically same as what you got
my PlayerMovement just cares about V3 inside moving, it doesnt care where inputs come from (bot, player etc.)

tender stag
#

im pretty sure i know what u mean tho

mortal obsidian
#

Alr thks

stiff rock
#

u guys here?

rich adder
#

I mainly stole from the Unity example assets anyway, since thats how i first learned the input system lol

slender nymph
# stiff rock u guys here?

at this point you should move your question to an appropriate channel. it is not coding related and has something to do with your setup most likely 🤷‍♂️

slender nymph
#

you can use id:browse to find a relevant channel

naive pawn
#

real quick, @stiff rock have you tried restarting

stiff rock
stiff rock
naive pawn
#

almost all of the channels are help channels

slender nymph
summer stump
slender nymph
#

they disabled scene lighting so it's probably not lighting

summer stump
#

Ah, missed that part

lethal bolt
#

I know what the problem is but i dont know how to fix it..

polar acorn
lethal bolt
#

My console was lagging so it showed an old error. I found out i didnt make an float..

naive pawn
#

no that's not the issue

#

read the error

#

look where you put the declarations for scorepoint and score

rich adder
#

I think thats what they meant by saying "i didnt make an float"

#

one can only hope they understood. Also VSCode really colors local vars the same as Properites and fields??

tender stag
#

just @ me

rich adder
tender stag
#

np

#

im busy anyway

#

trying to figure out client side prediction movement

#

with all that replication and reconciliation data shit

rich adder
#

no prob. its very basic anyway

#

you prob already know what I'm doing in it

rich adder
#

I just noticed it on my mac

#

oh yeah thought it was my theme..
at least my props are diff color

naive pawn
#

the default theme doesn't have a ton of colors
keyword 1 (for, if, else)
keyword 2 (class, readonly, int, get, public, new)
var
const
type
func
string literal
number literal

rich adder
#

yeah and changing it is annoying because you have to mess with json files..bummer.

naive pawn
#

hey since unity uses yaml for its scene/meta/asset/prefab files can you replace that with json

balmy rivet
#

how would i stop my player from getting stuck like this?

rich adder
#

or maybe it is.. we dont know..

balmy rivet
#

its running, but it dosent move anywhere cus there's like a small small ledge between the tiles

rich adder
#

you probably need the tilemap to have the collider thing

#

compound? composite ?

balmy rivet
#

compound?

naive pawn
#

no that's not the right word

#

composite yeah

rich adder
#

forgot what its called

naive pawn
#

same lmao

ancient holly
balmy rivet
#

composite?

balmy rivet
#

on the tilemap?

ancient holly
#

yeah

#

tilemap has many square colliders

naive pawn
#

have your tilemap collider be a composite and add a composite collider

ancient holly
#

which causes issues

#

that composite thing

#

turns it into

#

polygons

rich adder
#

make sure you put Used By Composite on the collider
and make the rigidbody it puts as static

ancient holly
#

which fixes the issue

#

you might need to set it from outlines -> polygons

#

for it to work

rich adder
#

make sure this is checked

balmy rivet
#

oh thanks so much!!

#

but how would i fix edges like this?

#

or jsut make the player walk over them

rich adder
balmy rivet
#

ok thank you!

rich adder
balmy rivet
#

yea ok thanks!

naive pawn
whole parcel
#

hey guys! im still trying to get the nodes from my tilemap into code. this is the method i'm trying, but it's giving me false data. anyone know why could that be?

#
    public bool[,] GenerateMap()
    {
        bool[,] map = new bool[tilemap.size.x, tilemap.size.y];

        for (int x = 0; x < tilemap.size.x; x++)
        {
            for (int y = 0; y < tilemap.size.y; y++)
            {
                Vector3Int tilePosition = new Vector3Int(x, y, 0);
                TileBase tile = tilemap.GetTile(tilePosition);
                map[x, y] = (tile == walkable_tile);
            }
        }

        return map;
    }
balmy rivet
rich adder
naive pawn
#

false values where there shouldn't be?

whole parcel
#

yea

naive pawn
#

make sure you're setting walkable_tile

whole parcel
#

i did

naive pawn
#

use Debug.Log to see if tile == walkable_tile is passing, or if it's not being reached for some reason

whole parcel
#

i did try that

#

it only passes for like five tiles

whole parcel
#

but ofc there are a lot more

naive pawn
whole parcel
#

kinda

#

it's comletely black tile

naive pawn
#

(btw, sidenote, convention in c# is to use camelCase rather than snake_case for fields. if you use camelCase, unity will automatically split the words for you)

naive pawn
whole parcel
#

those are pellets

#

and are in a seperate tilemap

naive pawn
#

yeah, but they arent blank tiles

naive pawn
whole parcel
#

the base are the walls

languid spire
#

you are comparing Tile References that will never be true

whole parcel
#

how come?

#

they are sometimes true tho apparently

naive pawn
naive pawn
whole parcel
#

more nulls than expected?

naive pawn
#

well, how many nulls are you expecting

whole parcel
#

it didnt show any

#

huh

naive pawn
#

well, that's a good sign

#

are there as many Wall_00 as you're expecting?

whole parcel
#

nope

#

shouldn't these be nulls tho

rocky canyon
naive pawn
whole parcel
#

no

#

empty spaces

naive pawn
#

also, are you passing the right Tilemap?

whole parcel
#

yea

#

im passing in the nodes tilemap

naive pawn
#

and that's the one with walls?

whole parcel
#

the black tiles

robust turret
#

quick question...

should I worry about security or effectiveness of my game from the start? If I am just messing around...

naive pawn
#

what do you mean by effectiveness?

cosmic dagger
#

effectiveness of game?

robust turret
#

It seems like I do find ineffecitve but workable solutions

polar acorn
naive pawn
robust turret
polar acorn
#

in that order

whole parcel
polar acorn
#

So you don't accidentally change something where you shouldn't

robust turret
naive pawn
polar acorn
naive pawn
polar acorn
#

but making it run is the first step

robust turret
cosmic dagger
robust turret
#

at what point I might start considering the limitations of unity?

whole parcel
#

i get a bunch of Nulls

rocky canyon
#

^ lol maybe a few weeks before.. if u got that hindsight DLC

cosmic dagger
whole parcel
#

and a few wall_00's

robust turret
naive pawn
#

@robust turret quick reality check, you're in analysis paralysis right now

naive pawn
robust turret
whole parcel
rocky canyon
#

just start..

whole parcel
#

i hv tons of wall_00's

rocky canyon
#

thats part of the rollercoaster

rich adder
#

Just DO IT ™️

naive pawn
naive pawn
robust turret
polar acorn
cosmic dagger
whole parcel
robust turret
#

btw any good 2d free assets suggestions?

naive pawn
polar acorn
#

But nothing runs slower than code that doesn't exist

rich adder
whole parcel
polar acorn
#

so make something go first

naive pawn
#

try disabling your other tilemaps and look at them one at a time

whole parcel
#

what will that do tho

naive pawn
whole parcel
#

nodes

rocky canyon
#

only if i had the will to use 2D

robust turret
#

should I worry about any malware when downloading assets?

naive pawn
rocky canyon
#

just dont open exe's

robust turret
rocky canyon
#

assets are gonna be .blend, .fbx, .obj, .png, .mp3 etc

naive pawn
rocky canyon
#

ive never come across malware in unity assets

#

and i been collecting for 3 years

robust turret
#

okay thanks ^^

#

to y'all

rocky canyon
#

find a good art pack

#

and let it inspire u

#

editor code + console commands + reflection stuff

#

ive maxed out my brain.. it hurts now lol

rich adder
#

ayee

rocky canyon
#

BUT i have a console tied into anything i chose to make a singleton from

#

it just works

#

now time to crunch some polish.. get my motivation back

rich adder
#

oh I thought the "Trace" command would show you debug rays or something

rocky canyon
rich adder
#

neat!

rocky canyon
#

time does a similar thing.. where u pass in a function and it logs the time it takes

#

soo in theory i created all my back-end systems already.. pickups, actions, health, shield, attack damage, etc

#

i can call all of it via the console..

#

now the hard part is putting it all together

rich adder
#

always is

rocky canyon
#

i have 1 issue tho.. is editor hotkeys.

#

when i try to search Player.. the Shift + P breaks out and pops up the Project Settings

rich adder
#

wdym ?

#

you can disable those

rocky canyon
#

(i had that off the side of the screen) thats why i have to reclick on the console after i type P

rich adder
rocky canyon
#

ohhh theres a button?!

rich adder
#

indeed!

rocky canyon
#

🙏 Unity

remote osprey
#

Is this way of comparing two instances ok?

        if (Instance == null)
        {
            Instance = this;
        }
        else if ( Instance != this)
        {
            Destroy(this);
        }

Or should i make a isEquals() method?

rocky canyon
#

then thats a NON-problem

#

and im going to ignore it lmao

rich adder
rocky canyon
#

it shouldnt happen in builds anyway

rocky canyon
remote osprey
# naive pawn what for?

I just wonder if the (Instance != this) is valid for Unity to compare two different objects of the same type

rich adder
rich adder
rocky canyon
#

best code i've ever used

#
using UnityEngine;
public abstract class Singleton<T> : MonoBehaviour
where T : Singleton<T>
{
    public static T Instance { get; private set; }

    void Awake()
    {
        if(Instance != null)
        {
            Destroy(gameObject);
            return;
        }
        DontDestroyOnLoad(gameObject);
        Instance = (T)this;
        DoAwake();
    }

    protected virtual void DoAwake() { }
}```
rich adder
rocky canyon
#

dude, i love it..

#

now if i could learn to do it on my own

rich adder
#

I see a lot of save systems without it and I cringe

remote osprey
#

I'm implementing a singleton, btw

summer stump
remote osprey
#

OK, cool

#

Thanks!

summer stump
rich adder
rocky canyon
naive pawn
rocky canyon
rocky canyon
#

i may try this in the future once i get more the overall project stable

rich adder
rocky canyon
#

zipties are my fav

#

actually turns out my save system is in a project all on its own.. and the rest of my stuff is in another

#

this oughta be fun

remote osprey
#

probably safer

rocky canyon
#

use that Generic implementation

#

you wont regret it

naive pawn
rocky canyon
#
public class TurkeyTrampoline : Singleton<TurkeyTrampoline>
{
    // can't beat it
}```
#

and u still have ur Monobehaviour acess

summer stump
#

Dang, too much to hope there was a trampoline react...

lost hamlet
rocky canyon
#

fresh idea 💡

rocky canyon
rich adder
lost hamlet
cosmic dagger
lost hamlet
#

Spent my whole day yesterday making a multiplayer lib

swift crag
lost hamlet
#

And it somehow got downloaded on nuget

#

76 times

#

I don't even know if it scales lol

#

I know it works fine tho, connected 4 clients together on a server

rocky canyon
rich adder
rocky canyon
#

and 1 hour.. thats quickness

rich adder
#

Oh def not 1 hour lol it was a long "coding hour"

#

my time is 1 min of coding time is like 1 hour in real life xD

lost hamlet
rich adder
lost hamlet
#

Nope, my own lib

#

it uses LiteNetLib under the hood

astral falcon
#

did you log the latency at some point?

lost hamlet
#

i made a test app and i got around 7ms from client to server on both LAN (my address) and localhost

#

it was a bit worse from client to client

#

like 12

robust turret
#

another quick question...
Can the Game Objects 2,3,4 inside the Game Object 1 branch be recognized by Game Object 1's script?
Or I should specify it

rich adder
#

is this server auth ?

lost hamlet
#

That's probably partly because of event polling

lost hamlet
swift crag
#

are you talking about the hierarchy, perhaps?

rich adder
robust turret
rich adder
#

those are Transforms children

swift crag
#

in this case, Bird is an object with two children: DownWing and UpWing

#

You can iterate over all children of a Transform:

robust turret
#

so should I reference them?

lost hamlet
iron wing
#

okay basically im having a lot more problems than i should with this. im trying to use unity's new input system. how can i simply detect when a button is pressed from my InputActionReference?

swift crag
#
foreach (Transform child in transform)
{
  // ...
}
robust turret
#

or Bird script knows it already

rich adder
#

if they are child of same script is prob better to do so

swift crag
#

You can also just directly reference the children.

#
[SerializeField] Transform downWing;
#

then drag "DownWing" into the Down Wing field in the inspector

rich adder
#

"find this here, put it here do this" yadayada

robust turret
#

I should also learn the terminology🥲

rich adder
#

scripts are just text files of instructions

rocky canyon
#

true story

#

; is end of a single line of command

#

domagic();

iron wing
rich adder
slender bridge
robust turret
robust turret
#

thanks ^^

rocky canyon
rich adder
#

was inspired by playing dying light again recently and they had this mechanic

rocky canyon
#

yea, those are the best kinds.. means u put attention to detail (it being something u were gonna use)

#

so when u share it, its pretty solid to begin with

rich adder
#

yeah i was very picky on going for the almost same feel and look of DL

rocky canyon
rich adder
#

I just need to find a good 3D model of a lock but its been difficult (for free and cc)

rocky canyon
#

what type of lock? jsut a keyhole one?

rich adder
#

yea

#

have you seen the dying light one before

#

or even fallout

rocky canyon
#

i seeen the first episode of fallout

#

b/c of the hype but i havent gotten around to seeing dying light yet

rich adder
#

oh no those aren't shows

#

i meant the game

rocky canyon
#

ohh, ofc ive played fallout lol

#

skyrim had a picking mechanic too

#

i enjoyed that one

rich adder
#

yeah its basically that

#

since bathesda just copies and pastes

#

changes the skins

rocky canyon
#

bethseda!

#

don't slur bethseda's name 😅 whats wrong with u

#

most glitch-free games ever made

rich adder
#

last good game was oblivion

#

and Fallout nv

rocky canyon
#

i have sooo many hours in that game is pathetic

#

i think i did 3 full playthroughs when i was younger

rocky canyon
#

is it just RNG stuff?

rich adder
#

can't speak for the original but thats what I'm doing

#

it does seem it can be rng

rocky canyon
#

with a skill modifier?

rich adder
#

i use a curve

rocky canyon
#

interesting

rich adder
#

the more diffuclt the lock, the less give the turn has

#

and easly breaks your pick

rocky canyon
#

you wanna friend me? i want to ask u some other questions but the channel isn't right for it lol, asset related*

rich adder
rocky canyon
rich adder
rocky canyon
#

thats basically all minigames summed up in a gif

rich adder
#

I was thinking it was angles at first
(all the videos i seen were doing some shit with angles)

#

but my brain cant brain rad too well

robust turret
#

mp3 is supported by unity right?

lost hamlet
#

yes

robust turret
#

ok

lost hamlet
rocky canyon
polar acorn
robust turret
#

m4a seems to not work

rich adder
cosmic dagger
rocky canyon
#

like make custom ones? im thinking of making a basic scene w/ all ur basic stuff included.. and use that as my starter projects

#

got to stress test it first and find any instabilites

cosmic dagger
robust turret
#

best way to edit mp3 sounds?

#

Audacity?

cosmic dagger
robust turret
rocky canyon
#

stuff like DoTween, TMP, Cinemachine, 2D package all that stuff i have to repeated add

robust turret
rocky canyon
#

soo i thought why not add all the stuff i need.. make a few simple things that everyone uses.. (include a Character Controller) and tada got me a phresh prototype project each time

robust turret
#

tho idk where XD

rocky canyon
#

ahh nah, i dont want someone elses template. 😄 im just curious when people actually do it themselves

robust turret
rocky canyon
#

lol.. not sure i agree with that.. but i wont judge

robust turret
#

its not smth I made up

polar acorn
#

To steal from one is plaigarism.
To steal from many is research.

naive pawn
#

to steal from all is programming

whole parcel
#

@naive pawn

#

is there a good way to check

#

if my grid in code is accurate

rich adder
whole parcel
#

how?

rich adder
whole parcel
#

rectangular

rich adder
whole parcel
#

oh

#

matrix

rich adder
#

You can draw them as a mesh probably

whole parcel
#

yea i hv no idea how to do that

rich adder
#

basically you can do mesh.SetIndices

#

or just use line renderer and call it a day

whole parcel
#

right

spiral rain
#

Can someone help me I am having a problem and so posted it on stack overflow https://stackoverflow.com/questions/78594391/weird-behavior-of-a-spline-unity-3d but no one is answering anyway here is what my problem is. I am using https://github.com/CMDRSpirit/RollercoasterDesigner this package is to make your own roller coaster. Sadly it is not very polished but I have one problem with it. When I set the StartSlope Variable it sets its own. Around 0.7 for y and 20 for z

I tried to get Chat GPT do help me fix it but that didn't work. I am at a loss I have no clue why this isn’t working. Please help.

GitHub

A toolset for creating and operating realistic rollercoasters in Unity. Includes per car simulation of forces, like rolling resistance and acceleration through gravity with full integration into th...

zealous hatch
#

NullReferenceException: Object reference not set to an instance of an object EnemyPatrol.FindTarget () (at Assets/Scripts/Enemy/EnemyPatrol.cs:90) EnemyPatrol.Update () (at Assets/Scripts/Enemy/EnemyPatrol.cs:44)

the if statement is the line 90

private void FindTarget()
{
    float targetRange = 50f;
    //Change GetPosition probably need to create a function in playermovement names that + have a look into this instance stuff
    if (Vector2.Distance(transform.position, PlayerMovement.Instance.GetPosition()) < targetRange)
    {
        state = State.ChaseTarget;
    }

`

 public Vector2 GetPosition()
 {
     return gameObject.transform.position;
 }

Gets position of the player.

I dont know why im getting the error

cosmic dagger
timber tide
#

something there is not like the other

cosmic dagger
#

only reference variables can be null. first, identify which variables are reference types. then check the value of each, one-by-one . . .

zealous hatch
#

all of them are giving normal numbers back

iron wing
#

I was initally going to use AddForce to make my Character Controller jump. Although, since it is not a RigidBody. There is no method for this. What can I do instead? I'm using SimpleMove, because I would rather not take the time to make my own gravity.

cosmic dagger
rich adder
#

also "custom gravity " is a simple v3 calculation, nothing insane about it.. the CharacterController Move method has an example

timber tide
#

gravity implementation is like two lines of code

iron wing
#

whaat

zealous hatch
iron wing
#

okay hold on lemme check this out

rich adder
iron wing
#

no no i just expected it to be weirdly difficult

rich adder
#

ohh nah that shits ez

timber tide
#

force accumulation is the hard part

zealous hatch
rich adder
cosmic dagger
zealous hatch
summer stump
cosmic dagger
zealous hatch
#

what if some rare insane unity error happen

robust turret
#

quick help with particles needed pls
I have clouds and I want them to spawn from the rightside of the screen at different speeds and move till the end of the screen and disappear
but somehow they are not accepted as a material for particle system

summer stump
zealous hatch
#

what if my unity got corrupted and that just happen

summer stump
robust turret
summer stump
#

I am rarely definitive like this, but it simply is impossible, in any situatiom
I have a bad habit of hedging my bets, but that is not necessary here

robust turret
#

should I just write a random spawn code with different speeds?

rich adder
#

or particle system shader, forgot which..prob latter..

robust turret
rich adder
#

i mean it was only 10 mins..

summer stump
rich adder
#

the cycle of perceived dead channel continues

robust turret
rich adder
#

also not everyone who knows code might know how particle system works well

robust turret
summer stump
prime ridge
#

Thank you

summer stump
#

There is a server for it

rich adder
robust turret
#

ohhh I see... not allowed to post in multiple channels

#

my bad

remote osprey
#

Hello

rich adder
#

especially when its not fitting to the channel

remote osprey
#

I have a link to a discord VFX exclusive channel if you want

#

DM in case

rich adder
summer stump
remote osprey
#

I know

#

which iss why i'm suggeting the person in need to DM

summer stump
#

Nav just got hit by it haha

rich adder
#

oh yeah if you hit it more than once you're done lol

#

it gets autoremoved anyway

summer stump
#

Slow phone is slow

rich adder
#

I hit it twice and got muted..second time with no http in link awkwardsweat

remote osprey
#

Sent the person in need to the VFX discord server in question

#

hope they find what they're looking for

robust turret
summer stump
rich adder
#

they certainly won't agree with that viewpoint of yours now,
its literally in the rules not to do it. but moving on..

robust turret
# summer stump <#497867528488484864> <#854851968446365696>

checked community conduct don'ts,,, nothing I have done wrong from there I believe
and in read-me... just spamming in different channels I suppose?

here is my logic...
somebody specialising in coding has higher chances of knowing a little bit of everything, while somebody specialising in other spheres (such as graphics, art, music etc.) can afford to go entirely into that sphere only

#

not acceptable?

rocky canyon
#

im artist turned developer. i post thru-out the channels.. but different topics each related to the channel

rich adder
#

if its a VFX question it belongs in VFX esp if its only been 10 mins you dont post in a code channel..thats just saying "ey I need to know this now, let me do as I please"

#

smells entitlement lol

robust turret
restive bone
#

Idk how to word this without sounding suspicious so here we go lol

rocky canyon
#

🫣

restive bone
#

Is it possible for my game to scan a user's file folder and do something with the information? The idea is to search for specific files and turn them into objects on a shelf that you can then interact with.

rocky canyon
#

lmao..

swift crag
#

sure, you just use the standard System.IO stuff

rocky canyon
restive bone
#

What's that?

rocky canyon
#

its a library that interfaces w/ the OS

#

save files, read files, move files, copy files

restive bone
#

(I'm ngl I've never touched Unity, I'm making this music project purely for fun and I'm just asking so I can keep notes)

rocky canyon
restive bone
#

I want to turn downloaded albums into physical records

rocky canyon
#

sus indeed

restive bone
#

Well, not literally physical

slender nymph
restive bone
#

But like, records on a shelf in the game

eternal needle
#

you should just let the user pick a file, which you may use System.IO for, and then do whatever shenanigans you want.

rich adder
rocky canyon
#

yea i see what ur wanting to do

eternal needle
#

Users will absolutely hate it if you just automatically get all audio files u can

rocky canyon
#

similar example: populate a bookshelf w/ all the TXT files on a user's machine

restive bone
#

For full transparency I've purchased these albums legally and expect my users to do the same

eternal needle
#

That isnt the issue, its just about how a user will feel if u go ahead and scan random folders in attempt to find audio files.

restive bone
#

I know EmuVR does this with ROM files instead of audio files

rocky canyon
#

ya, not sure i'd be down w/ giving those permissions to a game

#

u could probably make em feel better if its a folder inside ur build files..

#

that u can move ur audio files to.. to then see them in the game

#

not sure about u just willy nilly lookin around my machine tho

summer stump
restive bone
#

Ah, so having the music folder be inside the game files instead of scanning the user's C\Music

rocky canyon
#

ya, i feel like thats more acceptable

restive bone
#

Probably a lot easier to implement too

rocky canyon
#

or even let them chose which folder u look thru

eternal needle
rocky canyon
#

so they can manually pick their own library folder

restive bone
#

Dunno how I didn't think of that, I'm 99% sure that's what Emu does

rocky canyon
restive bone
rocky canyon
#

oh yea, thats fine then

restive bone
#

I kinda suck at typing, I carry myself much better over vc but I'm in the middle of 50 things atm and this was the most convenient way to ask

#

I just want to give people an interesting way to enjoy their music in VR

rocky canyon
#

👍 good luck with that.. sounds like it could be cool

restive bone
#

Now to find a good tutorial

restive bone
#

Oh cool! I didn't expect such a specific one to exist

rocky canyon
#

ya, i figured they'd be a simple one like upload custom avatar

#

that'd have all the same logic ud need for audio files as wel

#

System.IO makes an appearance!

restive bone
#

I was looking around at the more general ones to get myself used to the basics of Unity since I've never used it. I've seen a lot of people talk about Brackeys' videos, but they're almost a decade old and the UI is completely different.

rocky canyon
#

dont use brackeys please

restive bone
#

Is there some drama I need to know?

rocky canyon
#

his tutorials are okay but they're sooo "to the point" that they're hard to expand on

#

and alot of em are full of little bugs

rich adder
#

or its at times very wrong and gets corrected only sometimes in later video

restive bone
#

I see

rich adder
#

the gpt one 😬

rocky canyon
#

it really helped me when i first started

rocky canyon
#

its kinda meant to discourage you

restive bone
#

Before I really start working I do have one more question

rich adder
rocky canyon
#

ohh no, gosh no 🤢

#

not until u understand what ur doing

#

then i mildly approve

rich adder
#

Yeah it has helped me only a few occasions when I could not find specific formula online and surprisingly it did

rocky canyon
#

AI is only as good as the user commanding it

restive bone
#

Considering that

A. I've never developed before

And B. My Quest 2 has the battery life of a domestic hamster

Would it be easier to build my experience from the ground up for VR, or make a pancake build and then port it? Most of my friends don't own anything for VR so I would have more playtesters, but it might be harder to port interactions with almost 0 coding knowledge.

rich adder
rocky canyon
#

and then move into VR

#

its not gonna be a pleasant experience with a shitty Headset w/ no battery life

rich adder
#

indeed. VR is not too different anyway just the interactions change

restive bone
#

The Q2 is admittedly not the easiest to work with lol

rocky canyon
#

yup, but you wont be very good at that stuff from the get-go..

#

so best learn ur way up to it

restive bone
#

Alright, I'll take a look at those resources

rocky canyon
#

i made a VR type scene w/ just mouse controls.. mouse movement move the head.. left click simulated grabbing somethign with ur left hand.. right click -> right hand

#

but since i only have a Windows Mixed Reality headset.. i never expanded on it

rich adder
#

I should grab a vr headset and start doing some stuff 😮 I'm wayy behind on that

rocky canyon
#

me and u both

#

it'll be cringe by the time i get aruond to use it

restive bone
rich adder
#

Yea that might be the next move, I bet a nice HDRP project would be finee on that

rocky canyon
#

Google Cardboard FTW

#

forget yall rich folks

restive bone
rocky canyon
#

someone had a baaad experience

restive bone
#

I can play BONEWORKS for hours and feel nothing, but cellphone VR is truly the antithesis of the gods' light.

rich adder
rocky canyon
#

ohh i do

rich adder
#

also played around with Unity's RTX but my graphics card was crying, it did look good. HDRP still looks really good

rocky canyon
#

that was HDRP wasn'

#

t it.. i peaked on URP

rich adder
#

there is someothing about 6 the graphics on HDRP seemed to have improved

rocky canyon
#

not sure HDRP is worth the upgrade

restive bone
#

Oh dude, Unity has RTX support?

rich adder
#

for a while

restive bone
#

Wait til I find a way to badly implement this

rich adder
#

also we're kinda in a code channel so uhmm back ontopic 😅

rocky canyon
#

fr.. dang yall

lost hamlet
#

Which typically have the advantage but also disadvantage of not depending on ray tracing hardware

#

Weirdly enough I feel like the path traced games that perform the best are the ones using their own implementation, like Teardown for example

#

That thing runs on my 3050. Tried it even at 4K and it was kinda playable

#

At 900p (my monitor resolution) it runs over 110fps, max everything

#

Tho denoising isn't comparable to what Nvidia has

vast sandal
#

This is from the standard Unity ThirdPersonController Script:

` private void Update()
{
_hasAnimator = TryGetComponent(out _animator);

        JumpAndGravity();
        GroundedCheck();
        Move();
    }`

Is the ' _hasAnimator = TryGetComponent(out _animator);' part neccessary during update()?
It gets called during Start()... I thought stuff like this is quite "unideal" performance wise?

slender bridge
slender bridge
vast sandal
# slender bridge What is `_hasAnimator` even being used for.

`private void JumpAndGravity()
{
if (Grounded)
{
// reset the fall timeout timer
_fallTimeoutDelta = FallTimeout;

    // update animator if using character
    if (_hasAnimator)
    {
        _animator.SetBool(_animIDJump, false);
        _animator.SetBool(_animIDFreeFall, false);
    }

    // stop our velocity dropping infinitely when grounded
    if (_verticalVelocity < 0.0f)
    {
        _verticalVelocity = -2f;
    }

...
`
I assume for this

teal viper
slender bridge
#

You only need that once unless you have some weird code somewhere else that removes the animator

vast sandal
#

Hm.. maybe it is neccessary in order to update the animator on every frame?
But even than wouldn't it be better to get that component once and store it globally?

teal viper
#

There's probably no hidden meaning behind that code. It was just implemented like that for simplicity

vast sandal
#

Aight gotcha..
So.. what would u suggest?
Get that info once and store it in a persistent variable?

slender bridge
slender nymph
slender nymph
#

click the link. read it.

ruby ember
#

no

#

this is getting bullshit

slender nymph
#

then don't get help

ruby ember
#

fuck this server

slender nymph
#

you're welcome to leave 👋

slender bridge
rocky canyon
#

imagine getting all pissed off b/c someone sent you a resource that would actually prove to be beneficial to you... and even learn you a way to get help more often, and of better quality.. and then rage-quit taking all the bad etiquette w/ u

slender bridge
#

DVUnit doesn't have to imagine.

ember tangle
#

UnityEngine.Random vs Unity.Mathematics.Random?

swift crag
#

UnityEngine.Random uses a static rng state, so you don't have to manually create a random instance and then ask it for random values

#

This can be a problem in some cases (like if you want to have multiple distinct RNGs)

#

Everything in Unity.Mathematics was designed to be usable in Burst-compiled code (which can run much faster, but requires you to use only a subset of C# features)

#

I would use UnityEngine.Random unless you have a compelling reason to use the Mathematics random

ember tangle
#

its telling me that Random is an ambiguous reference between the two so I need to pick one or the other I guess. I added a line that used Mathf.PerlinNoise

#

Okay looks like UnityEngine.Random it is for me

swift crag
#

you may have accidentally added the using Unity.Mathematics directive

ember tangle
swift crag
#

Mathf is part of UnityEngine.

#

Get rid of the Unity.Mathematics directive and see if you get any new errors

remote osprey
#

Hello

#

Is there a Deque data structure implementationin Unity?

swift crag
#

oh, a double-ended queue

remote osprey
#

yesss

ember tangle
rocky canyon
#

IDE's tend to do that

remote osprey
#

Double Ended Queue

#

Deque

rocky canyon
#

sometimes i'll have 3 or four unneeded crap up there i have to remove

swift crag
#

so that should provide efficient insertion and removal at both ends

slender nymph
remote osprey
swift crag
#

I turned off automatic namespace insertion

#

I kept getting a really goofy directive for..

#

this one is especially funny because it's a UnityEditor class

#

so it'd randomly explode my builds

rich adder
#

obscure af.
I love getting the Visual Scripting ones

#

apparently Start is a class in the Visual Scripting namespace

vast sandal
#

public bool TryGetComponent<T>(out T component) { return gameObject.TryGetComponent<T>(out component); }
Does this return the component or just a boolean when it finds said component?

swift crag
#

The return type is bool

#

Therefore, it returns a bool

#

It's impossible for it to return anything else.

#

It will also assign the component it finds into that out parameter

rich adder
# vast sandal ` public bool TryGetComponent<T>(out T component) { r...

the reason this returns a bool and not a component is because its already doing a null check for you
Same as writing

MyComponent myComp = GetComponent <MyComponent>();
if(myComp)
//do stuff```
the `out` is just a way to return a value or more from method without changing return type
vast sandal
#

so..

`If(TryGetComponent(out component)){

changeSomething(component)

}`

would work..?

rich adder
#

assuming you already defined type of component

#

other wise you need to include it after the out

vast sandal
iron wing
#

why cant i modify the return value of Transform.position inside of my Character Controller? It says it's not a variable, even though I can modify it's position in the editor.

Cannot modify the return value of 'Transform.position' because it is not a variable

rich adder
hasty sleet
hasty sleet
#

I saw something about the null check being overridden but i do not recall

#

Oops yeah

rich adder
slender nymph
summer stump
#

There was a conversation about this earlier, a rider dev said it is.. a bug? They said it wasn't right

rich adder
#

must be second one today it seems lol

slender nymph
hasty sleet
restive bone
#

Can someone explain this code error? my code is the following:

#

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

public class Test1 : MonoBehaviour

int frameCount;

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

// Update is called once per frame
void Update()
{
    frameCount += 1:
    print ("Update");
}

}

#

Assets\Test1.cs(18,24): error CS1513: } expected

eternal falconBOT
frosty hound
#

Your int frameCount is outside of the { } surrounding the class

restive bone
#

I see what I did there

restive bone
#

Wait a minute

#

This is already how it's set up

#

It naturally uses it

rich adder
restive bone
#

My bad

#

What I mean is, it was already set up that way

#

All my scripts open in VS

rich adder
#

that doesn't mean its configured

#

it would be underlined red where it was missing

restive bone
#

I'm colorblind

#

Things tend to fade into the UI easily

rich adder
#

syntax errors are equivalent to spelling errors

restive bone
#

I have it installed, connected, and I have the extension. What more do I need to do?

restive bone
rich adder
restive bone
rich adder
#

you can literally look at the logos that match the taskbar icon..

#

how are you unsure

restive bone
rich adder
restive bone
rich adder
#

its fine no worries

#

do you have any errors in Output tab in vscode?

restive bone
#

I don't think I've ever seen it

#

However, I do get a million messages about not having the .NET something or other

rich adder
#

yup

#

that would be it

#

you would need to install the .NET SDK and restart the PC so the PATH properly updates to include the dotnet command , helps for Intellisense to work

ivory bobcat
restive bone
#

So what does the .NET SDK do?

#

Installing now

restive bone
rich adder
restive bone
#

Ah, that makes sense

#

Well now it is installed

rich adder
#

make sure you have restarted the PC, removed the Visual Studio Code Editor package from Unity Package manager , and click Regen Project files in unity for good measure

olive galleon
#

Does anyone know a solution to my problem: Each time a create a new Enemy gameobject it shares the same health as every other enemy, is there a way to decouple them? I'll provide code is necessary but don't know what exactly to send, my Enemy script or HealthManager script or the Script that casts the attack function.

summer stump
#

Or is the health in an SO?

olive galleon
#

I have a HealthManager class in an object and it's a singleton that the enemy scripts calls, i dont believe it's static

summer stump
#

And all the enemies use it?

#

Where is health? That is what I'm trying to find out

slender nymph
#

it's a singleton
that doesn't sound right

summer stump
#

Health should be in a script attached to each enemy

olive galleon
#

Oh ok, thank you I'll try that !

summer stump
#

Anything you want to be separate needs to actually be separate

feral sapphire
#

How do i make a button that plays random musics (audios) ? I made a empty object and put a small script on it with "randommusic" and made a button with the click "playrandommusic" but nothing happens once clicked.

slender nymph
#

hint: read the warning in your IDE, it's helpful.

spare mountain
slender nymph
#

more specifically assigning it to a local variable and then never using that local variable (which is the point of the warning i mentioned)

spare mountain
#

exactly

feral sapphire
#

im just thinking basic stuff. audio - music haha xD.. so if mention a audio it should play in my head

spare mountain
#

random question - why should monobehaviors not be instantiated directly?

#

(like new Class)

slender nymph
#

because unity manages the creation of components so they are added on the C++ side of the engine. if you construct it directly it won't do that so it won't receive messages like Awake, Update, Start, etc. nor can it be added to a gameobject

spare mountain
slender nymph
spare mountain
slender nymph
#

yes, no point in inheriting from MonoBehaviour if it doesn't need any of the inherited behaviour of a MonoBehaviour

spare mountain
#

you're very knowledgeable

slender nymph
#

just comes with experience, i've been using unity for several years now and i try and dedicate at least a little time each day to utilizing those skills/knowledge

spare mountain
feral sapphire
#

how come the Audio source gets removed from the Object once play testing in editor?

teal viper
feral sapphire
#

managed to fix that now :3 ty

iron wing
#

for whatever reason, this block of code in the update method, doesnt actually seem to reset my velocity when my charactercontroller is on the floor, unless I'm walking up some slope. has anyone had this issue?

{
    Velocity.y += Gravity * GravityMultiplier * Time.deltaTime;
    Character.Move(-Velocity);
}
else
{
    Velocity.y = 0f;
}```
charred spoke
#

Are you calling move after setting the y comp of the velocity to 0 ?

burnt vapor
iron wing
burnt vapor
iron wing
#

thank you oh wise one 🙏

burnt vapor
# iron wing thank you oh wise one 🙏

So now that you know this, why does it not update to the new value? Is this a variable you control? If so, when is it changed and why doesn't this apply? At that point you can start doing more logging

iron wing
#

does it matter at all that my character controller is placed above my ground? if so, can this be a result of some of my code or should i be looking in my player's properties?

burnt vapor
#

If it's the collission that floats above the ground then it probably isn't aware that you are grounded due to the distance

iron sand
#

I need some help figuring out why i can't get my grounded checks working

#

everything i've tried has done nothing to help

#

i've looked up tutorials on youtube and even showed my code to chatgpt

burnt vapor
eternal falconBOT
iron sand
burnt vapor
#

So what is the issue? Does GroundCheck() not work?

iron sand
#

apparently not, because every time i try to jump, the debug log says i'm not grounded

burnt vapor
#

Then likely Physics.BoxCast is not returning what you think it does

iron wing
#

Uri above solved my issue!! that took like 5 hours but I'm really glad it kind of works now.
but yeah, i still haven't figure out why IsGrounded isn't working. Which I do need later. I'm not sure why it's hovering above the ground. Nothing should really be changing it in the code I don't think.

https://paste.ofcode.org/tkxNjubRZ5dkvJQwKNCNXX

please excuse the messy code this is my first ever project 😟

iron sand
#

according to a video i watched, that code from line 110 downward should be casting a box, but there isn't one no matter what size i put

iron sand
#

yeah

spare mountain
# iron sand yeah

read the docs and tell me where it says it draws a box on the screen

iron sand
#

here's the same thing from the video

spare mountain
#

he must be doing something else

#

boxcast doesn't render anything

iron sand
#

well that's what the gizmo is for (i think)

spare mountain
#

possibly

eternal needle
iron sand
#

oh yeah, I can see it now

#

on an unrelated note I no longer need help with this, after some irl discussion i'm gonna be using a prebuilt controller moving on with my project, rather than building my own from scratch

flint thicket
#

hi i have a problem

#

where my keycode dose not work

#

so i cant turm left or right

#

i dont think is a programing error

#

nvm

#

i restarted my unity and everything works fine

sonic dome
#

how do i fix this

burnt vapor
sonic dome
#

correct?

burnt vapor
#

The error is clear

sonic dome
burnt vapor
sonic dome
#

where is that

burnt vapor
#

My guess whatever is the "connecting" part of your game

#

Or don't you have any specific web requests in your game?

sonic dome
burnt vapor
#

Please share it

languid spire
#

I think, in this case, it is a server configuration problem. The server is not set up for the correct Mime type for .wasm files

sonic dome
languid spire
#

presumably you have a web server, configure it correctly

sonic dome
#

im using pun 2

languid spire
#

but your code is being served from somewhere

sonic dome
#

yep

#

which code should i share here

languid spire
#

why do people do stuff that they understand absolutely nothing about?

sonic dome
#

i mean it worked fine in local host

#

so it has some issue when i sent it to hostinger

languid spire
#

is hostinger where you are serving your build from

fossil drum
languid spire
#

RTFM and do research first. Not just blindly dive in

languid spire
#

So, that is where you need to change the configuration as I said above

sonic dome
#

so it has nothing to do with the build rather the server config?

languid spire
#

yes

sonic dome
#

okk let me see

languid spire
#

the Unity docs contain a section on how the server should be configured

sonic dome
#

okk let me try to find it

#

figured it out

#

wasnt the server issue

#

now works fine

stuck palm
#

Is a list FIFO?

iron wing
#

for whatever reason IsGrounded is really confused on what it wants to be. I'm using a singular Move(); method inside of the Update method. I have no clue why this is happening, I'm using the default properties for a capsule and it's CharacterController.

https://paste.ofcode.org/SHU5yQZmKJBBzEtT7Z8UZ5

The messages printed in the output are simply the result of print(Character.isGrounded);

ivory bobcat
# stuck palm Is a list FIFO?

A list requires you to provide a target or index when removing individual elements - what you're probably thinking of are queues and stacks.

#

The isGround variable updates when the character moves so if it's fluctuating that would mean that you're likely moving and colliding into the ground (possibly with gravity) but not always - if the delta time factor is minuscule that frame, you just might not have triggered is-grounded to be true (my assumption)

Was the CharacterController touching the ground during the last move?
https://docs.unity3d.com/ScriptReference/CharacterController-isGrounded.html
Maybe have your own isGrounded property that would be true (grounded) unless you've been ungrounded for a set amount of time (some threshold, for example 200ms). @iron wing

naive pawn
vast vessel
#

will the static DialogEventCallback method at the bottom, modify EventInstances that was passed to it on line 85?
will the mthod like actually modify the dictionary and remove an item from it?

burnt vapor
eternal falconBOT
burnt vapor
#

Also, tryitandsee

vast vessel
#

i dont want to crash unity again

burnt vapor
#

Log the list of known instances before removing it and after removing it for example

vast vessel
#

it takes so long to boot up

burnt vapor
#

I don't see how a crash is relevant here, sounds like a different issue