#💻┃code-beginner

1 messages · Page 747 of 1

edgy sinew
#

Well the item is SetParent to player's hand. Then these rotation/position offset applied

rocky canyon
#

do it.. (use localRotation to compensate for children)

edgy sinew
#

What do you mean by that?

rocky canyon
#

transform.rotation is global..

edgy sinew
#

Oh like that. Yeah i'm using localPosition already

rocky canyon
#

and localRotation?

edgy sinew
#

Doesn't seem like I have to reset the globals to 0,0,0

#

Yeh

rocky canyon
#

still need more context

edgy sinew
#

.. Huh lol

rocky canyon
#

u havent said what the actual problem was

naive pawn
#

you're basically asking for pivot logic, right?

edgy sinew
#

No

#

I'm asking if there's a chill way to configure these for each of my items

rocky canyon
#

(set initial position + rotation per object)

edgy sinew
#

Probably to just position it by hand in scene view, save the values?

naive pawn
#

just.. make the origin an pivot in your prefab or whatever, so you can just parent that and not have to worry about it at all

edgy sinew
#

Okay so, the invisible child game object idea

naive pawn
#

no, as a parent.

edgy sinew
#

Oh you mean, the item has an empty parent that's adjusted

#

Essentially changing the pivot point / origin

#

Rather than "applying some offset" after equip to player hand

naive pawn
#

imagine you have, let's say the hand, in a neutral position around the prefab's origin
you would then position your meshes/sprites/whatever based on that origin, which is based on the neutral hand position

#

and that positioning can be done with child objects if necessary (if you can't set the pivot for meshes or something. idk how 3d works)

edgy sinew
#

Thanks! I might try that if just "manually place it nicely & record the values" takes too long

naive pawn
#

this is manually place it nicely and then let unity record the values

edgy sinew
#

[SerializeField] Quaternion is not fun ... There's only 3 numbers but it's not euler angles

#

yeah like if you change the X value the other 2 start changing ...

#

That kind of thing. It's like computed on the spot, so weird

naive pawn
#

oh yeah no that's normal

#

what's weird is that it's 3 values

#

quaternions have 4

edgy sinew
#

I assume so, since they're hiding the 4th

#

ye

#

Idk why it's like that, it's like misleading to look like it's euler angles

#

Wait I could just have the entire Transform serialized maybe?

#

ANyway. Thanks for the help

naive pawn
#

a Transform is pos/rot/scale but also parent and children

edgy sinew
naive pawn
#

that's very odd

#

what version are you on?

edgy sinew
#

6.0 .58f2

naive pawn
#

im on 2022, so might be something that changed in 6

edgy sinew
#

ah. yeah lol Bruh

naive pawn
#

i mean you shouldn't edit quaternion internals anyways, so if you want to serialize a rotation it should probably be in eulerangles anyways

edgy sinew
#

yeah i only avoided that route since it showed up with 3 values 🤷‍♂️ misleading

#

gonna try "Copy > Position" and rotation see where i get with that

naive pawn
#

ok imma just be blunt

#

why are you asking here if you aren't gonna take our advice lmao

#

there's a reason why "pivot" has its own name

#

it's useful

edgy sinew
#

knowledge

naive pawn
#

the alternate routes you're suggesting are just, more work

edgy sinew
#

I'm not ecstatic about having invisible child game objects either

naive pawn
naive pawn
edgy sinew
#

maybe I'll need it in 10 minutes after i realize the way im trying is too much hassle

naive pawn
#

or you could actually apply the knowledge now and see a nice, clean workflow

edgy sinew
#

Your explanation is not that clear

naive pawn
naive pawn
#

i cannot read your mind

cosmic dagger
#

Just came to say, "don't mess with an actual Quaternion value" . . .

edgy sinew
#

I don't really understand what to do.

naive pawn
#

create a gameobject
put your "item" as a child

edgy sinew
#

So my item, I give it a parent empty game object, and then I can freely adjust the item gameobject, effectively changing the "pivot"

#

Is that it?

naive pawn
#

yes

#

so you do understand then 😂

edgy sinew
#

Okay thanks. I'll give it a shot like i said.
I'm not ecstatic about that method because it changes the structure

#

Now I may have to do FindComponentInChildren or whatever, or go up and down the hierarchy manually

#

Thanks so much, I appreciate your help & this is definitely a great solution. in Blender we can just change the pivot point so, this is the Unity workaround eh

naive pawn
naive pawn
#

you might be able to, try googling around.

edgy sinew
#

yeah you can of course

#

in Blender, but not in Unity. hence the "parent game object" hack 🫡

#

I wish they'd leave the Unity AI stuff alone and give us better Blender integration

naive pawn
#

i'm talking about changing it in unity...

edgy sinew
#

I thought it's Blender only, just like applying scale or rotation etc

#

Or you're referring to the "empty parent game object" hack that lets us fake the pivot point edit

naive pawn
edgy sinew
#

yeah i dont think you can. same way you can't "apply" scale or rotation, once it's an FBX that's all baked

naive pawn
#

a quick google seems to suggest that the answer is not easily, but the forum post i checked was also slightly old

#

apparently someone made an editor script to do so

edgy sinew
#

That's wild. I wonder how that's even possible

#

It must be very low-level, like C++ itself or. Idk how you'd gain access to that internal FBX data

naive pawn
#

low-level, like C++ itself
that has nothing to do with it lol

#

it's all just data in the file

#

any programming language can modify files

edgy sinew
#

I meant that i doubt the Scripting API has anything built in for that

naive pawn
#

or maybe that editor script isn't doing that, and is instead applying something after-the-fact, but it still doesn't really matter

naive pawn
edgy sinew
#

It would, in C++ ..

#

Many packages on the asset store do raw C++

naive pawn
#

no, not how stuff works

edgy sinew
#

Ok bro

naive pawn
edgy sinew
#

Good to hear, so then?

naive pawn
#

maybe you get access to public methods without c# bindings for whatever reason, but i doubt there's a ton of those

edgy sinew
#

Yeah it's... it's hacky

#

Basically re building what Blender does in Unity lol

naive pawn
# edgy sinew Good to hear, so then?

you can modify the mesh pivot in blender
you can use the editor script to modify it in unity
you can use a parent gameobject to make an artificial pivot in unity

edgy sinew
#

I found some stuff online, I think it's actually not that hard to do. But I can't find anywhere how to see all available data of the Gamepad

#

gyroX = ds4.GetChildControl<ButtonControl>("gyro X 13");
This line of code works for my Gamepad, but other ones like "gyro Y 14" throw an error. I just need the internal labels of the Gamepad

naive pawn
#

please don't ping specific people for new questions
a new question would just be a new convo

edgy sinew
#

Mb thought it was chill like that. Sorry

naive pawn
#

me answering your previous question doesn't guarantee i can help with a different, unrelated question, so it doesn't really make sense to ping me for that

edgy sinew
#

All that to save 3 mouse clicks in Blender

#

Mental

rocky canyon
#

soo.. i just ran into using static ... ; thats pretty neat..

using static Spawn.Helper; FunctionA();```
instead of  `Spawn.Helper.FunctionA();` or even 
```cs
using Spawn; Helper.FunctionA();```
not sure i know how it works exactly.. are there any "gotchas" with this approach? or should it even be done vs the normal approach of using namespace and coding `Class.Function`?
naive pawn
rich adder
#

imo they are more handy when you got some type of nested type

rocky canyon
#

ohh ok

#

wow.. u learn something new everyday

naive pawn
#

as usual with including namespaces, the main concern would probably be naming conflicts

rocky canyon
#

cool, i like it

naive pawn
#

using static to get SomeClass.SomeMethod -> write a new CurrentClass.SomeMethod -> stuff breaks because the old calls now point to a different method

edgy sinew
fervent bramble
#

can someone help me with my game I just finsihed doing my animation transitions from idle to walking to running etc and the way i triger them with will bool paramiters and i want a player controller that allows me to link those animation so when i walk the walking animation plays etc

solar hill
#

youre asking for a locomotion set up?

#

theres a thousand youtube videos showing how to do it, its pretty simple

fervent bramble
rocky canyon
rich adder
solar hill
fervent bramble
solar hill
rich adder
#

you can use this and link the player move speed in the code to control which animation plays
something like animator.SetFloat("MoveSpeed", character.MoveSpeed)

fervent bramble
#

thanks

edgy sinew
rocky canyon
edgy sinew
#

You can switch animations in code with CrossFadeInFixedTime. No more spiderman web

rich adder
#

ehh if you have few animations its fine

naive pawn
rocky canyon
#

lol true

rich adder
#

but yeah if you start creating a huge nest you should probably do it programmatically

edgy sinew
#

Any game worth making has more than a few animations

naive pawn
#

flappy bird

solar hill
#

just do everything procedurally 🤑

rich adder
naive pawn
#

yeah no i don't get the spiderweb thing

#

ill probably get it at some point, but that just hasn't happened for me

rich adder
#

I think a game with most animation was in a GDC it was Firewatch and they also used animator, albeit very clever and "organized"

rocky canyon
# rocky canyon

this is kinda facepalm moment tho.. lol
ive made my own static debug classes and always tried to do clever stuff like
call the class D and then the functions would be called bug() or ebug()
so i could do D.ebug.Log("Custom stuff");
and now im freaking realizing i coulda just done something easier w/ this using static declaration 😅 gotta laugh at meself

solar hill
edgy sinew
#

Idk, combined with a state machine and some AnimationCurves, i'm fully in love with CrossFadeInFixedTime

rocky canyon
solar hill
#

i guess coming from unreal being to do anything in a blueprint esque system is more ideal for me

edgy sinew
#

Oh yeah i hate blueprints. prefer to do things in code

cosmic quail
#

blueprints suck though

edgy sinew
#

everyone has their preferred cup of tea

rocky canyon
solar hill
edgy sinew
solar hill
rocky canyon
#

theres visual scripting for unity ykno

solar hill
#

yeah i know i tried it

#

didnt like it

rocky canyon
#

ahh ok

solar hill
#

i get my daily taste of blueprints with the animator lol

rocky canyon
#

😈 lol

naive pawn
#

btw, this is the code channel

edgy sinew
#

man let us vibe

#

when someone comes with an actual question we'll lock in

#

🥺

naive pawn
#

this convo was about animation from the start though

solar hill
#

it was about answering a question

#

that had to do with animation

naive pawn
#

a question about animation

fickle plume
edgy sinew
#

hopefully it's answered by now

naive pawn
#

so.. this channel isn't the right place for it

solar hill
#

guess you can tell that to the original person who asked the question lmao

fervent bramble
rich adder
fervent bramble
#

"InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
UnityEngine.Internal.InputUnsafeUtility.GetKeyString (System.String name) (at <203eea2e137a4ed1b7efeba5ef6d9400>:0)
UnityEngine.Input.GetKey (System.String name) (at <203eea2e137a4ed1b7efeba5ef6d9400>:0)
AnimationStateController.Update () (at Assets/AnimationStateController.cs:16)"

when trying to do

"if (Input.GetKey("w"))
{
animator.SetBool("walking", true);
}"

in the void update function

radiant voidBOT
fervent bramble
#

ok

radiant voidBOT
# naive pawn !input
How to Set Input

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

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

rich adder
#

oh there is command for that? niceee

spring oak
#
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.SceneManagement;

public class baseHealth : MonoBehaviour
{
    public int totalHealthValue;
    public int chestHealthValue;
    public int houseHealthValue;
    public int waterfallHealthValue;
    public TMP_Text totalHealthText;
    public TMP_Text chestHealthText;
    public TMP_Text houseHealthText;
    public TMP_Text waterfallHealthText;
    public GameObject gameOverScreen;

    void Start()
    {
        totalHealthValue = 750;
        chestHealthValue = 250;
        houseHealthValue = 250;
        waterfallHealthValue = 250;
    }

    void GameOver()
    {
        SceneManager.LoadScene(2);
    }
    void Update()
    {
        totalHealthValue = chestHealthValue + houseHealthValue + waterfallHealthValue;
        totalHealthText.text = totalHealthValue.ToString();
        chestHealthText.text = chestHealthValue.ToString() + "/250";
        houseHealthText.text = houseHealthValue.ToString() + "/250";
        waterfallHealthText.text = waterfallHealthValue.ToString() + "/250";
        if (chestHealthValue <= 0)
        {
            chestHealthValue = 0;
        }
        if (houseHealthValue <= 0)
        {
            houseHealthValue = 0;
        }
        if (waterfallHealthValue <= 0)
        {
            waterfallHealthValue = 0;
        }
        if (totalHealthValue <= 0)
            {
                GameOver();
            }
    }
}```

why do the enemies still go towards the destroyed bases :/
#

pls assist me

fervent bramble
solar hill
#

under the edit tab

#

top left

fervent bramble
#

thanks'

rich adder
rich adder
fervent bramble
rich adder
#

make it a habit to research

spring oak
rich adder
naive pawn
spring oak
#

ill remember that @rich adder

rich adder
#

this is literally a pain in the ass to look on mobile

solar hill
spring oak
#

let me reformat ts

solar hill
#

jk

#

anyways yeah we need more context

#

to actually help you

naive pawn
spring oak
#

i was just looking for someone willing to help

#

not an immediate answer

solar hill
#

we are the ones who are willing to help but we need context

spring oak
#

so i was gonna provide context when someone responded

naive pawn
#

yeah no, not how this works

solar hill
#

youre allowed to do it right away

naive pawn
#

we beg you, just provide all the info right away

rich adder
spring oak
#

didn't realize there were a lot of people who wanna help

naive pawn
#

so we don't have to play this game of telephone

spring oak
#

ok

rich adder
#

if they have to play detective, they will most likely walk away or not respond

spring oak
#

give me a min rq

naive pawn
#

and this is why you should provide all the info straight up

spring oak
#

do i just give the blazebin link to my thing

edgy sinew
#

yeah the “anyone can help me?” is like a daily thing I see

edgy sinew
#

no ur good ive done it before too

naive pawn
#

there's always a first, we don't judge

but if it keeps happening, we'll start judging 👁️ 👁️

edgy sinew
#

it can be tough waiting on replies so. we get it

naive pawn
solar hill
#

to be fair, it does show a lot of character in effectively not wanting to immediately dump your issues on everyone without seeing if anyone wants to help first but its also unfortunate that its simply not the way discord or most online forums work

#

and i dont mean unfortunate in a bad way

#

its very efficient lol

naive pawn
#

it is definitely unfortunate that the efficient ideal and the presumed moral ideal don't align
but imo once you get used to the efficient ideal, it's so hard to go back to the moral ideal lmao

edgy sinew
spring oak
#

https://paste.mod.gg/basic/viewer/zusqvyuyuaqb/1
basically its a 2D tower defense game, and my enemy units switch directions to go towards different bases. It uses a tilemap system, so there is a tile with the tag "crossroad" that tells the enemies which way to go. Normally, it makes them go in a random direction (left, down, or right), but it's supposed to check if a base is destroyed and make it exclude that direction from the options. I don't know why it isn't working though.

cosmic dagger
spring oak
#

i have an itch.io page for it but it isn't fully updated so lmk if you want me to update it so you can see it

#

i probably just messed up a math check thing :/

solar hill
#

i think your changedirection() is failing because its overlapping random logic without actually excluding destroyed bases, so enemies can still pick the invalid directions without choosing from the active ones

solar hill
#

im not sure though i could be wrong which i frequently am

#

so uh wait and see what the others say

spring oak
#

kk

#

i change 1 number and unity takes 40 seconds to reload domain

#

ts pmo

solar hill
#

ok looking at it again

#

youre going to have to build a list of valid directions first and then randomly pick from those valid options

spring oak
#

alright

floral garden
#

Anyone has experience with ink dialogue ?

grand snow
#

I think i last looked at ink like 7+ years ago so probably no

merry thunder
#

hello
i am very new in this unity game dev platform
doing my first project and i stuck at a point of animation
can anyone help me a bit

solar hill
#

incredible

edgy sinew
#

@merry thunder send the details we gotchu

rich adder
merry thunder
#

i did't ignore it
i was trying it from yesterday night but its not working

solar hill
#

i dont want to be rude here but i do notice how bot messages seem to be some sort of blindspot for a lot of people

#

not exclusively to this server

#

and i have no clue what causes it

rich adder
#

yeah people with reading comprehension issue and attention span of an ant

merry thunder
#

i tried to add a animated character at the last panel when the game ends and shows the winner/loser
the animation is working showing in animator and animation panel but the animation is not visible in the panel but other than that is visible

rich adder
#

is this a code question or what, I don't even understand where the question is

floral garden
#

Is it a layer priority problem ? Maybe it is behind a panel that hides it ?

merry thunder
#

i myself is not sure where did it go wrong

floral garden
#

Who know how should i make include of my ink dialogue file ? (I mean) for a small projet is fine but if we have a lot of dialogue should i juste make some independent dialogue alone and make a big included file for dialogue that need sharing info ?

edgy sinew
keen dew
edgy sinew
#

“Playing an animation on a character” is a simple question, but this is clearly more

merry thunder
edgy sinew
#

People send pictures in here all the time

#

If it’s code use triple backtick or one of the pasting websites

#

!code

radiant voidBOT
rich adder
#

this is a code channel

edgy sinew
#

If his problem isn’t in code we’ll go elsewhere

rich adder
#

its a mystery at this point

floral garden
#

I made it but those include , should i juste make main story -> include all other dialogue => doing jump between dialogue from the main

#

If so , how should i attribute dialogue to npc ?

keen dew
#

Yes. Except jump between dialogue by starting the story directly from knots

floral garden
#

How should i start directly from knot ?

#

Because before i just drop the file ink generate from the ink file directly from the inspector

#

(The json)

floral garden
#

Ohhhh

#

😭

#

I read the document but doesn’t het everything

keen dew
#

There's a dedicated Ink server, you know. This is only tangentially related to Unity

floral garden
#

Oh thx i will go find it then

merry thunder
#

i have added 4 codes to the blaze bin how to share it

floral garden
#

Save

#

Then past the url

#

I get the same issue before lmao

merry thunder
#

previously i was stuck at showing the player stats at the end screen
now at this

crimson canopy
#

hey, is there a way to get whatever script is attached to a gameobject, regardless of the name?
for example, i would normally get a script via myObject.GetComponent<scriptName>()
but lets say i want to get whatever the first script attached to an object is, is that possible?

merry thunder
#

i think its possible i guess, by adding a script in assets then drag it to the inspector in the gameobject

rich adder
tough lagoon
rich adder
#

Moni

tough lagoon
#

😄

crimson canopy
tough lagoon
#

I.e. everything derives from Bob. And you use overrides to change the behavior when needed

crimson canopy
#

hm ok, whats a good resource for how best to take advantage of inheritance

cosmic dagger
crimson canopy
grand snow
#

This is why understanding programming and OO concepts is useful

#

trying to learn programming alongside unity means you probably wont know about this stuff

cosmic dagger
merry thunder
#

@floral garden bro if you check the code i pasted and understand why its not working pls let me know
it's 3 am now and i can't focus on that anymore good night
if you need anything else to understand it ask me
thanks

floral garden
#

Goodnight to you , i will check it in 2 days because i am very busy next day UnityChanBye UnityChanClever

merry thunder
#

sure

#

thanks bro

grand snow
#

🤔 hmmm

#

(this is why beginners shouldnt rely on other beginners for help)

merry thunder
#

you can check it also if its possible and tell me where it go wrong

grand snow
#

I started looking but 1 big jumbo script is hard to read though

#

your UI should not be mixed in with your gameplay logic

floral garden
#

Btw is it a better way to split my player stats machine or should i just put it in a file?

grand snow
#

what is a stat machine

floral garden
#

Fsm

grand snow
#

hmm nope no idea

floral garden
#

Like how unity work

#

How to said. Instead of doing one file where you manage everything, you split it into multiple class each manage one thing. Like idle, walk, run , death

#

Unity is more complex but see it as awake start update fixedupdate etc

rich adder
#

those are not even close related to state machine

floral garden
rich adder
#

those events are not state machine, the closest state machine built in unity is Animator

grand snow
#

I cant follow what you mean but its always best to have a class perform one task. You may be confused about what state machines are.

#

Start/Update/Awake are message functions for MonoBehaviours and thats it.

forest notch
#

hi, i wanted to change the terrain color, and the editor also got orange, and its working with every color, what the hell is that? 😭

forest notch
#

oh, sorry

#

Terrain.activeTerrain.materialTemplate.color = Color.green;

rich adder
#

looks like playmode tint is on

forest notch
#

but this is a code

#

xd

grand snow
#

we would have known if provided in your message

grand snow
floral garden
rich adder
#

you're better off making a terrain shader and do terrain properly

#

unity terrain finally leds you make shadergraph terrain shaders

grand snow
floral garden
#

Yes and i mixed it with the fsm xd

rich adder
#

these are just functions called at specific times

floral garden
#

A finite-state machine (FSM) or finite-state automaton (FSA, plural: automata), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some inputs; the chan...

merry thunder
floral garden
#

Just a state you can change when you need. Other than using a lot of If or switch

rich adder
grand snow
#

dw i know what they are 😆

floral garden
#

With enum is some called fake fsm (my teacher said)

rich adder
#

fake fsm lol

#

if you're in a state you're in a state, sometimes you don't care about OnEnterState events and such

grand snow
grand snow
#

Soo many teachers have such outdated views its worrying

floral garden
rich adder
#

idk what you mean tbh

#

you dont always have to abstract everything

#

..some of the biggest games have been made with simple switch and enum

floral garden
#

It is only a method UnityChanThink

rich adder
#

not sure what you mean "it is only a method"

floral garden
#

To replace a big switch or if else

rich adder
#

depends on the game.. you can also split it

#

switch can handle lots of cases with ease though, generally speaking is preferable over chain of if else

floral garden
#

I never said it can’t UnityChanHuh

#

I have not exemple rn

rich adder
floral garden
grand snow
#

and in games we often prefer speed over some over engineered solution with needless layers

floral garden
#

Oh?

rich adder
floral garden
#

I have done some game but still beginner

rich adder
#

the quickest example that came to mind cause i looked at their source code A LOT

#

"fake fsm" all over the place, very succesful product . Straight to the point code

floral garden
#

Is it in C ++ or c# ? Or both

rich adder
#

c++

floral garden
#

O-o?! Damn

#

A lot of case

#

Maybe i should read some unity game source code

#

(If there are)

rich adder
#

you would need a special account for that

#

its closed source publicly

sour fulcrum
floral garden
sour fulcrum
#

hence why i said comparable

rich adder
#

if you're lucky you find the source codes people do reverse engineer

#

the original repo got DMCA'd though so someone else reposted

sour fulcrum
#

most people don't reverse engineer unity games because usually they don't have to

floral garden
#

Nah i prefer source code people want share other than stealing

rich adder
#

You can peek for curiosity / learning

#

something like dotPeek works

#

but yeah I cannot say much more cause I'll get kicked

floral garden
#

Ok

#

Thx

eternal needle
#

theres no real point to even going through source code unless you're interested in a very specific feature. code in your singleplayer games does not need to be complex

sharp mango
#

I'm going absolutely insane

using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.Tilemaps;

public class WorldManager : Utilities.Singleton<WorldManager>
{

    [SerializeField] private List<GameObject> pathObjects;
    [SerializeField] private Tilemap tilemap;
    List<Path> paths;
    private List<Path> pathsWithEnemies;

    //Initialize the Direction array array
    void Start()
    {
        InitPaths();
    }

    void Update()
    {

    }

    void AnchorPoints()
    {

    }
    void GetDirectionFromPath(int pathID, int currentIndex)
    {
        //return paths[pathID].tileList
    }
    void InitPaths()
    {
        int x = 0;
        foreach (GameObject pathObject in pathObjects)
        {
            paths[x].GeneratePath(pathObject, tilemap);//
            x++;
        }
    }
    void UpdateEnemiesOnPath(Path path)
    {

    }
}

for some reason, adding a serializeField to the list here makes it so unity starts having a spasm, failing to display things in the inspector, and giving like 10 different errors

I have absolutely no clue why it's doing this? I'd swear I used this method already in another project to add elements to a list from the editor

#

(referring to the serializeField in pathObjects)

rich adder
radiant voidBOT
floral garden
#

Maybe it can’t be serialized

rich adder
#

if you're on the latest its "normal" its a known bug

sharp mango
sharp mango
rich adder
rich adder
sharp mango
#

I'm on 6000.0.58f2 specifically

floral garden
rich adder
#

always keep a repo commit before doing these upgrades

sharp mango
#

the previous version of the project was also unity 6, but apparently it had a security vulnerability and we were forced to upgrade

rich adder
rich adder
#

besides you can use their patching tool for binaries and work fine with the editor with "security issue"

sharp mango
#

I'm downloading 59f2 to check if it's still there

floral garden
#

It will block the issue ?

eternal needle
floral garden
#

Or bypass

rich adder
floral garden
#

Oh i see

rich adder
#

so really changing editor in a haste is a panic move

sharp mango
#

(The rest will be worked out later for now I just need this damn list to work)

eternal needle
#

the displaying editor text error is known at least. I remember someone mentioning a fix with fonts but i never looked deep into that.
either way your current code would still always error

#

paths is not initialized

rich adder
#

oh yeah you wil def catch a NRE for Path list

floral garden
#

Nre?

rich adder
#

the display thing hopefuly is fixed in 59f2

sharp mango
rich adder
#

a list must be initialized otherwise it will throw when try to access

#

public / serializefield in unity will serialize them in inspector so it will initialize them for you

floral garden
#

Oh also, how is the correct syntax for initialization ?
List<gameobject> list = new() or
New List<gameobject>() ?

sharp mango
#

it's New List<gameobject>() no?

floral garden
#

I don’t know, people always write it both side but only new() is fine

#

Btw Both is correct

rich adder
sharp mango
#

huh

#

I always do list = new list <T>()

floral garden
rich adder
floral garden
#

Ahhh

eternal needle
#

unless you use var everywhere

rich adder
#

If you write an asset or something and someone is running older unity version with c# 8 or less it wont be happy

floral garden
sharp mango
#

(you are allowed to use var? at all?)

rich adder
#

not as fields / props / return values, but as local vars

floral garden
#

Like var value = 1

rich adder
#

use var is good when you know the type is explicit enough

floral garden
#

Var = int or size_t or other depend what you are giving

rich adder
#

if its vague and you only know through IDE it could be a problem

rich adder
floral garden
#

Reel

rich adder
#

but good naming can also fix the second example
CalculateHealth() probably returns a number . etc

floral garden
#

Moral : var is good but use it in parcimonie

sharp mango
#

clearly some kinda code at least

floral garden
rich adder
twilit ocean
#

Trying to logically think about how to develop a simple health system, any feedback on what I should probably not do?

A separate script that can be attached to any GameObject entity as long as it has a dedicated Hurtbox collider set as child, and give it health/damage/death interactions.

It will look for a child with the name "HurtBox" and set it to be a trigger for health decreasing.
Within it there will be the damage data of everything in the game listed.

It will also change the health data based on what object it's attached to.

I might separate health calculation and damage calculation into 2 different scripts once I'm more knowledgeable in the topic (since damage will have some specifics and might become complex).```
 I also thought of allocating all the game damage values, types, ETC in a different file but I'm not sure how that would work.
rich adder
#

the health component should not care about any triggers / colliders

twilit ocean
rich adder
#

it should have a method you can use to modify health and all that responsibility

#

it only cares about changing the values and keeping track, it should not care HOW it got those

#

make another component for trigger damages

#

so you can have other means of affecting health not just using triggers only

#

say you make a TriggerHurt component, it only cares to tell a Health if one exists, "Hey I got hurt subtract 10 hp" etc.

twilit ocean
rich adder
#

you create a field of Health and assign it , if its not null you communicate to it

#

this way you can create other triggers or functions that talk to Health, what if you have healing potions / trigger areas and so on

#

tight coupling should be used sparsely, no reason health should need a triggercollider to function

grand snow
#

Ill point out that its probably a bad idea to have specific components for "health" and "damage"

#

there comes a point where we have gone too specific and it makes things harder

twilit ocean
rich adder
#

why should my health care about triggers and physics?

rich adder
#

you dont even need to check Player usually anyway, like

void OnTriggerEnter(Collider other){
if(other.TryGetComponent(out Health health))
health.Remove(10);```
twilit ocean
grand snow
#

I just read this and imagined 1 tiny ass monobehaviour with 1 float/int for health and thats it. That would be kinda silly.

rich adder
sharp mango
rich adder
#

this way i can do other things in other scripts that care about health

rich adder
#

they should've done a proper check before releasing 58f2 in such a haste

grand snow
rich adder
eternal needle
rich adder
sour fulcrum
#

The objective problems with Unity we get in here have significantly raised 6.2+

eternal needle
#

yea fair, i did have issues very quickly in 6.2.1. An int going to large values crashed my editor lol

#

i mean i accidentally kept multiplying the value with itself but still, you'd expect it to not crash

rich adder
#

:tinfoilhat moment but the big push for AI "enabled" editors is the same reason microsoft is getting rid of local accounts for w11. Who knows what more tracking they want to do while you develop for their training

#

the tag should read "Supported but Broken"

#

"Recommended" misleading newcomers to the AI enabled bs by default

winged ridge
#

Nobody forces you to use 1 unity, 2 ai
I haven't once used UnityAI and told them as much myself, I don't plan on doing. But I understand how it may be helpful to others. Unity have just had potential security issues highlighted so that I'd hope.. is their main concern

latent vapor
#

📒┃

#

sorry mis click

sour fulcrum
winged ridge
#

Godot
Unity
Unreal engine
RpgMaker

#

And they do have multiple teams focusing on multiple projects within unity, pretty standard industry practice.

sour fulcrum
#

For 3D (and most genres) RPGMaker is completely unviable

There are many reasons why Godot and Unreal are either flatout unviable or would cost too much time to be viable

sour fulcrum
winged ridge
# sour fulcrum And some are getting way more love than others

At the moment perhaps, but security is a big issue at the moment so I'd rather unity focus on that than minor annoying bugs such as their (already reported) GUI bug for the editor. Security over visuals any day.
As for AI.. hundreds of companies are focusing on it as it's 'Flavour of the month' meaning it will have its time and pass

sour fulcrum
#

The lack of quality control is highlighted in this specific instance but is not exclusive to it

#

While I hope it’s a flavour of a month type thing it’s still something that’s actively happening

winged ridge
#

Unity on average have 5,000 staff. This Discord alone has over 120,000 members, if every person reported an issue and they all had to be tested, even if you allocated every member of staff to testing and reporting back on bugs/problem fixing. Realistically where do you, think this may end up

sour fulcrum
#

Not particularly interested in engaging with such an unreasonable hypothetical

winged ridge
#

Explain why it's unreasonable? You are the one demanding they focus on QA.. yes some of it's dropped but within a year they let go of roughly 2,700 staff, reported financial losses and had some internal issues

sour fulcrum
#

Because it’s nowhere near the scale of 120,000 unique bug reports

sour fulcrum
winged ridge
#

This discussion could go on far too long, if you wish make a thread we will discuss in that, otherwise. All I ask is be considerate of the staff already working hard to provide to us Unity engine as it is, flaws included

twilit ocean
#

Why on earth would I ever want to overload a method instead of just using discernably different signatures? Are there practical uses for them?

tacit prism
#

i know this might sounds stupid but in unity uh...

is there any way to make the icons and lettering in my project bin slightly larger

Like view percent from 100-110 or something

cant find anything for it :(

rich adder
twilit ocean
#

I just don't understand how can something like that be pratical.

rich adder
#

different levels of control for the same function

eternal needle
winged ridge
rich adder
twilit ocean
twilit ocean
mossy wind
#

Ya'll know whats wrong wit this code??

using System.Collections;
using UnityEngine.UI;

public class EventTriggers : MonoBehaviour
{

    public GameObject dialoguePanel;
    public float delay = 2.5f;

    public IEnumerator ShowDialogue(float delay)
    {
        yield return new WaitForSeconds(delay);
        dialoguePanel.SetActive(true);
        yield return new WaitForSeconds(delay);
        dialoguePanel.SetActive(false);
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            StartCoroutine(ShowDialogue(delay));
        }
    }
}```
eternal needle
eternal needle
twilit ocean
cosmic dagger
cosmic dagger
#

I left my mind-reading cap in the other room . . .

mossy wind
# cosmic dagger Care to provide any context?

basically i was trying to make the code to activate a panel when it was touched... but it just won't show it. i have tried checking the tag, or maybe it was missing a reference but it still persist...

cosmic dagger
rich adder
mossy wind
cosmic dagger
#

If so, place a log inside of the trigger method to check if it appears . . .

cosmic dagger
rugged beacon
#

is this 2d or 3d

cosmic dagger
#

Then move to the coroutine. Place a log at the top to check that it runs . . .

mossy wind
#

wait guys... i think i figured it out, something was wrong with the collider. thanks for the help tho, appreciate it.

mossy wind
cosmic dagger
#

But you said the trigger method worked, which indicates the collider is fine . . .

tacit prism
#

what does this error mean? having a hard time translating it. I notice its about my middle button input returning null but

#

worried i might have messed up my input system somehow

#

:(

#

the other 2 errors are about the input giving them a null reference and not being able to use it

rich adder
tacit prism
#

i really dont understand as it was working completely fine, i have videos of it working perfectly, but now it stopped once I updated my targeting requirements (in which period i "accidentally" put Control.IPlayerActions in a seperate script because i was playing around and fiddling with shit)

#

even more it really shouldnt be feeding a null to my target script since, as far as i understand the operand, the ? shouldnt be returning if it comes up null

rich adder
#

whats the entire stacktrace say

tacit prism
#

Ive been told about how deep the inputsystem package goes into the project, in those exact words, so i dont know what it implies

#

i dont know how to pull up the entire thing, im still fairly new to unity (as per my question about font size earlier) so all i have is the console

#

To be honest i looked up what that was an saw a lot of console text

winged ridge
#

So the first error in your console says that you have a variable that has not been assigned, this may be a gameObject for example
The third error relates to the first

#

The second error relates to your input which is probably not finding the middle mouse button (Mouse Button 3)

tacit prism
#

do i have to rebuild my middlemouse input?

#

i mean its not that hard to just delete and do it again

tacit prism
#

ill look over it in the morning but leaving the night with an error makes me not happy :(

winged ridge
tacit prism
#

Now I’ll have a fun surprise tomorrow morning

#

At least I know this for future issues

winged ridge
tacit prism
#

Thanks

slender nymph
#

runtime exceptions will not cause the editor to enter safe mode so there is no need to comment any of that code out.
also the middle error isn't directly related to your middle mouse input, it's something that is called in response to that action's performed event being invoked

#

presumably the first exception is the cause of the second

tacit prism
#

Yeah just thought about that too

My inputsystem can’t be playing wrong right now since literally all of my other inputs were fine, why would only the middlemouse one get hammered out of nowhere

I’ll have to look around my targeting script in the morning, should have done anything tonight as I was half asleep anyhow

#

Not saying it’s impossible but

rain solar
#

how do i program manifold dual contouring? there are zero public implementation on the internet

teal viper
rain solar
teal viper
rain solar
#

third also isnd MDC

teal viper
#

broken code..?

#

Beyond that, I guess your best approach is to read the paper, understand it and implement yourself.🤷‍♂️

rain solar
#

if u read the QEF solver code it brute forces it with rotation matrices, causing it to take like 6 seconds to generate a tiny mesh

teal viper
rain solar
#

is this just a rare algorithm? surely people need isosurfaces

teal viper
#

Most people use simple marching cubes . I've never seen anyone trying to implement anything more complex.

rain solar
#

anyways ill keep trying, thanks

teal viper
#

Why not?🤔

rain solar
teal viper
#

Pretty sure marching cubes can handle coreners just fine.

rain solar
#

unable to do corners

rain solar
#

if u try to make marching "cubes" generate a cube, it simply cannot

teal viper
#

Corners

rain solar
#

thats not a cube nor are those corners

teal viper
#

I guess what you're trying to say is 90 degree corners

rain solar
#

yeah

teal viper
#

Ok, but you can get pretty close to it.

rain solar
#

not without going super high res and killing performance for what should be a 12 triangle shape

rugged mirage
#

I've been stuck on this but I've been trying the (now not new) input system in unity and I have movement for my player set up but I can't figure out how to make the player move on a local scale with it since I have the camera rotate the player and would like movement to adjust with rotation and I'm starting to think that this is not a thing you can't do with the input system.

teal viper
rain solar
#

i have the high res marching cubes implemented rn and the corners are very noticably buggy

teal viper
#

Then perhaps it's just a bug in your implementation.🤷‍♂️

rain solar
#

its a known limitation of the algorithm

teal viper
#

Ok. Anyways, if you need help on that specific algorithm, I'd recommend starting a thread in #1390346827005431951

teal viper
rotund root
#

(i know there is a paste as value but it's still too slow)

old zealot
#

Sa

warped sparrow
#

hi

naive pawn
median valve
#

i need some help with a tutorial ive been doing

north kiln
#

Just ask your question

median valve
#

can i upload screenshots

sullen epoch
#

I've got a question, i was researching LINQ and saw people generally advising against using it as it allocates memory and fills unity's garbage collector. but there arguments were all targeted towards using it on a per frame basis. so it it generally fine to use outside or regularly repeating logic or on start?

fickle plume
sullen epoch
#

im creating a personal "Guidebook" because writing things down yourself and doing your own research is one of the bet ways to commit to memeory.
at the moment my topics of focus are

  1. Vectors, angles and Trigg
  2. Mathf Fundamentals
  3. LINQ - although i'm back to the drawing board on that one
  4. order of execution
  5. object oriented and data driven architecture
  6. state machines
  7. asynchronous programming.
#

any other essential topics i should research?

rocky canyon
#

nailed it

naive pawn
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

ripe shard
#

Asking a online community what’s important without context will yield generic, cluttered non-helpful answers that miss your actual needs.

sullen epoch
#

I can respect that, but that’s actually why I asked — while every project has its own foundation, there are still core principles that help you structure things properly from the start. Those constants are what I’m trying to get a better understanding of.

ripe shard
#

also, your and everyone‘s opinions on that evolve with experience and you probably wouldn’t fully appreciate certain recommendations without a lot of details and lived experience that produced it.

#

Not saying everything needs to be reinvented, just that some things can’t really be taught by passing compact information

#

the key thing to figure out (imo) is: ways to collaborate effectively with others in complex projects. Everything else is a component of that ultimate skill. Code is a complication in that, which you need to minimize. So when looking at code subjects: ask yourself how the thing makes collaboration easier/harder. from that you find additional topics to explore. If it doesn’t help with collab, you can flag it as unimportant. Caveat: “getting stuff done/working” is part of collaboration, but the complexity is in “keep it working, with minimal effort, when 1000s of other things are also going on” (integration).

rocky canyon
#

and it'll evolve as u go.. so i'd just hit it

void bluff
#

Hello!
I just started using unity, with no basis, and as you can probably guess I'm having a hard time with coding.
So I watched a yt tutorial on how to make player movements and camera look (1st person).
Everything works fine, except for the 1st person look. The camera follow rlly well my mouse movement, however it feels not smooth at all. If someone has an answer to my issue, please help me

#

here is my code too :

keen dew
#

How do you call ProcessLook?

void bluff
# keen dew How do you call ProcessLook?

Honestly I don't really understand it, I just copied that script from youtube, I tried to understand it but it's too difficult for me, if you want I can send you the InputManager script

keen dew
#

Sure. 👇

#

!code

radiant voidBOT
grand snow
#

haha what did i just see

void bluff
#

ahah I'm discovering it's taking a bit of time for my little brain

#
// using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class InputManager : MonoBehaviour
{
    private PlayerInput playerInput;
    private PlayerInput.OnFootActions onFoot;

    private PlayerMotor motor;
    private PlayerLook look;
    // Start is called before the first frame update
    void Awake()
    {
        playerInput = new PlayerInput();
        onFoot = playerInput.OnFoot;

        motor = GetComponent<PlayerMotor>();
        look = GetComponent<PlayerLook>();

        onFoot.Jump.performed += ctx => motor.Jump();
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        //tell the playermotor to move using the value from our movement action.
        look.ProcessLook(onFoot.Look.ReadValue<Vector2>());
    }

    private void LateUpdate()
    {
        motor.ProcessMove(onFoot.Movement.ReadValue<Vector2>());
    }

    private void OnEnable()
    {
        onFoot.Enable();
    }
    
    private void OnDisable()
    {
        onFoot.Disable();
    }
}

keen dew
#

It should be Update instead of FixedUpdate

void bluff
#

alright let me change it

void bluff
keen dew
#

Update runs every frame, FixedUpdate runs at a fixed time interval (50 times/second by default). That's why the movement looked jagged because it moved the camera less often than the framerate

void bluff
#

I get it, thanks a lot!

keen dew
#

Also mouse input shouldn't be multiplied by deltatime

void bluff
keen dew
#

Well remove the part that multiplies by deltatime

void bluff
#

Alright

void bluff
keen dew
#

I mean remove the part that multiplies by deltatime on both lines

#

and then you have to change the sensitivity down to about 1

void bluff
#

Oh yeah I was saying "that is fast"

#

Yes it is so much better thanks.

#

Also I want to hide my cursor while playing, do you think this is a good way?

using UnityEngine;
using System.Collections;

public class CursorScript : MonoBehaviour
{
    // Use this for initialization
    void Start()
    {
        //Set Cursor to not be visible
        Cursor.visible = false;
    }
}```
keen dew
#

sure

void bluff
#

alright I'll try it, thanks again

rocky canyon
void bluff
grand snow
#

a whole singleton for hiding the cursor? overkill imo

rocky canyon
#

and it keeps all the cursor mechanics in a single place

lunar narwhal
#

EventSystem.current.SetSelectedGameObject(object)
Hello, I just upgraded my unity project to Unity 6. Previously, When a menu opened up in my game, I would use the above line of code to select a UI element. Then the player could navigate the menu using a contorller. "EventSystem.current" seems to have been renamed to just "Event.current." I am struggling to find a way to select a ui element now though as "SetSelectedGameObject()" seems to be a thing of the past. Does anyone know how to do this in unity 6?

wintry quarry
#

EventSystem is correct

formal swan
#

Hi, do any of u know how to connect a button click that leads to a ui with a camera pan? I have been trying to search for tutorials that can do both, like if I open this menu, the camera zooms in on the character. But there hasn't been anything like that

grand snow
#

well the button click would trigger some animation or code that moves a camera of your choice

#

cinemachine can make things like this easier

formal swan
#

I made a button with an on click () prompt, that sets my ui gameobject active when pressed. I also have a camera manager script for using cinemachine

#

I just don't know how to combine them

grand snow
#

then you are already half way there. Enable some virtual camera and configure the anim time and mode for ANY > that camera

#

E.g. serialize a reference to the virtual camera and enable it when the button is pressed

formal swan
#

oh that's good then! How can I do that? Is it through the script?

grand snow
#

yea...

#

first try just enabling a virtual camera (in the function called by the button) placed where you want the pan to go to and give it a high priority number

#

the virtual camera should be disabled initially

#

If that still confuses you then re learn about virtual cameras in cinemachine

hexed jungle
#

hi I use code: Debug.DrawRay(transform.position, directions[i], Color.red);
but I don't see those lines
I use Gizmos but it doesn't help

formal swan
#

Hm I do have the priority switch set up, should I type the button on click() in the enable field?

wintry quarry
#

And is the code even running?

hexed jungle
#

private void CheckForPlayer()
{
CalculateDirections();

for (int i = 0; i < directions.Length; i++)
{
    Debug.DrawRay(transform.position, directions[i], Color.red);
}

}
private void CalculateDirections()
{
directions[0] = transform.right * range;
directions[1] = -transform.right * range;
directions[2] = transform.up * range;
directions[3] = -transform.up * range;
}

#

I'm looking in "Game" like in tutorial

wintry quarry
hexed jungle
# wintry quarry when do you call `CheckForPlayer`?

public class Spikehead : EnemyDamage
{
[SerializeField] private float speed;
[SerializeField] private float range;
[SerializeField] private float checkDelay;
private float checkTimer;
private Vector3 destination;

private bool attacking;

private Vector3[] directions = new Vector3[4];

private void Update()
{
    if (attacking)
    transform.Translate((destination - transform.position).normalized * 10 * Time.deltaTime);
    else
    {
        checkDelay = Time.deltaTime;
        if (checkTimer > checkDelay)
        {
            CheckForPlayer();
        }
    }
}
private void CheckForPlayer()
{
    CalculateDirections();

    for (int i = 0; i < directions.Length; i++)
    {
        Debug.DrawRay(transform.position, directions[i], Color.red);
    }

}
private void CalculateDirections()
{
    directions[0] = transform.right * range;
    directions[1] = -transform.right * range;
    directions[2] = transform.up * range;
    directions[3] = -transform.up * range;
}

}
this is my code for this

wintry quarry
#

use Debug.Log in the future tomake sure your code is running as expected

naive pawn
#

!code

radiant voidBOT
grand snow
# formal swan Hm I do have the priority switch set up, should I type the button on click() in ...

Perhaps you didn't fully understand how priority works. the highest priority virtual camera that is enabled is what gets used by cinemachine.
Therefore we can disable and enable one with a high priority number to control when that "takes over".
e.g.

[SerializeField]
CinemachineCamera panCam;

[SerializeField]
Button button;

private void Start()
{
  panCam.enabled = false;
  button.onClick.AddListener(() => panCam.enabled = true);
}
wintry quarry
near finch
#

hey can someone help me with a unity problem :)

#

im using unity 2d

formal swan
grand snow
formal swan
#

Well yea... I might have gotten it confused since I thought the inputs could include UI buttons, it sounded like the same category

umbral pond
#

hi im new to coding i was watching some tutorials for 2D but problem is its in old input system should i also learn old input system is it easy to convert its coding to new system or should i start from learning new input system and ignore old tutorials

formal swan
#

So I'm kinda stuck atm, Im not sure how to follow up from here, might have to rework my script. I'll try it the way u scripted ur example

grand snow
formal swan
#

aw man, thought mouse included sth like click buttons ToT

grand snow
#

left and right click? ofcourse it does

stoic dagger
#

Wsp

umbral pond
#

im good

#

how about you

stoic dagger
#

I’m good tho

#

Guy’s

umbral pond
#

should i learn old input system im beginner

#

or ignore old tutorials

grand snow
umbral pond
#

aight

#

thanks

near finch
#

hey guys im new to unity! im using unity 2d to create a side scrolling game - quite simple but im stuck as the player just falls through the tilemap... i have followed some tutorials and nothing is being resolved. All the solutions say 'check composite collider' but there is not an option to do this...i have followed the tutorials exactly how they are supposed to be as well

umbral pond
#

do you guys know any resource or video to study new input system 2D ?

cosmic quail
near finch
#

box collider 2d

umbral pond
#

thx

grand snow
#

lets get you out of tutorial hell early

cosmic quail
near finch
#

yeh the tilempa has a collider, is trigger is also not checked

cosmic quail
near finch
#

yepp

cosmic quail
# near finch yepp

and then did you add a composite collider 2d too? like all the tutorials are saying

near finch
#

yep

umbral pond
#

can you send ss with player components and groudn components

cosmic quail
near finch
cosmic quail
near finch
rugged mirage
# teal viper Maybe provide some more details on the issue. What's the expected behavior and w...

(I just got here so I don't really know the proper format to share code)

But I have a action input variable that reads the player WASD input in respects to a 3D space and is read as a vector3 in the script

[SerializeField] InputAction playerControls;
...
void Update()
moveDirection = playerControls.ReadValue<Vector3>();

Then in the fixed update I have a playercontroller (previously referenced in script use the playercontroller.Move() funtion

void fixedUpdate()
playerController.Move(moveDirection * playerSpeed * Time.deltaTime);

Then I have a basic camera movement function for the player

mouseX += Input.GetAxis("Mouse X") * Time.deltaTime * sensitivity;
mouseY -= Input.GetAxis("Mouse Y") * Time.deltaTime * sensitivity;

mouseY = Mathf.Clamp(mouseY, -60, 60);

playerCamera.transform.rotation = Quaternion.Euler(mouseY, mouseX, playerCamera.transform.localRotation.z);
transform.rotation = Quaternion.Euler(transform.rotation.x, mouseX, transform.rotation.z);

The end goal here is to have the player's movement direction adjust with the way they are facing (as you see in many first person game) but I can't figure out how to stop the player from moving around based on world scale and have them move around based on local scale.

near finch
#

i tired setting composite operation to none

grand snow
cosmic quail
# near finch

what's the Grid component for? haven't seen that before.

near finch
formal swan
#

Ok so I've tried to replace my current codes to match the template, but I'm not sure how to go on from here

grand snow
#

The point of the example was to illustrate how we can enable/disable the cinemachine camera in code

#

and my example used a UGUI (ui) button

formal swan
#

Sorry, I thought it fits cuz I do have a UI button set up

#

The button I want is from an image I set up in the canvas, how can I clarify that?

grand snow
#

cool then that is a UI button. You confused me with talk of the input system

grand snow
formal swan
#

yea I confused myself too lol

grand snow
#

also images of code suck, send code as text or use a !code site

radiant voidBOT
formal swan
#

Ok let me give it a try 👍

rugged mirage
cosmic quail
# near finch

just set the composite operation to something and it should work

#

they removed that "used by composite" thing because its not needed

grand snow
near finch
rugged mirage
grand snow
#

Ideally you rotate your player on Y and rotate your camera on X (only for both)

#

THEN this should work much better

fervent bramble
#

Can someone help me I want to make a first person game but use this free model i found on the asset store called banana man https://assetstore.unity.com/packages/3d/characters/humanoids/banana-man-196830 and give him movement and eyes. I tried using the free offical unity first person controller prefab and replacing the character but that doesn't work please i need some help

Elevate your workflow with the Banana Man asset from Banana Yellow Games. Find this & other Humanoids options on the Unity Asset Store.

rugged mirage
grand snow
#

unity doesnt use nuget so

grand snow
sudden cypress
#

Is new input system easier than old

subtle hinge
#

https://github.com/fatoastcatbruh/Script

Really need some help fixing something. Im making a multiplayer card game about diseases. I need to update a bool in the enemys BodyUI script from the player who plays the card "HC()". Right now the player playing the card doesnt have access to the other players BodyUI script for some reason. Pls help thanks 🙂

GitHub

Card Hand. Contribute to fatoastcatbruh/Script development by creating an account on GitHub.

fervent bramble
#

Can someone help me I want to make a first person game but use this free model i found on the asset store called banana man https://assetstore.unity.com/packages/3d/characters/humanoids/banana-man-196830 and give him movement and eyes. I tried using the free offical unity first person controller prefab and replacing the character but that doesn't work please i need some help

Elevate your workflow with the Banana Man asset from Banana Yellow Games. Find this & other Humanoids options on the Unity Asset Store.

#

Can i get some help with my game

cosmic dagger
solar hill
fervent bramble
#

wdym

stoic dagger
#

Guys I just need a help.

solar hill
#

We need to know more about your setup

#

how your handling certain things

#

exactly whats not working etc.

cosmic dagger
sudden cypress
stoic dagger
#

How to change the brown grid colour into other colour can you give me some guidelines thanks.

cosmic dagger
fervent bramble
# solar hill We need to know more about your setup

I don't know how to give my player movemnt and really can't code so i am asking if anyone has a video or an asset the allows me to eaisly give a humanoid such as this https://assetstore.unity.com/packages/3d/characters/humanoids/banana-man-196830 to be controlled by the player and have a camera in the first person perspective

Elevate your workflow with the Banana Man asset from Banana Yellow Games. Find this & other Humanoids options on the Unity Asset Store.

sudden cypress
solar hill
#

not without understanding a couple of nuanced things

#

you are best off watching seperate tutorials for player controllers and animator implementation

fervent bramble
solar hill
#

as for the controller theres a million tutorials out there

rotund needle
#

necesito ayuda

stoic dagger
#

Guy’s I already send it out can someone give me some advice

stoic dagger
#

Check the refer over here.

rotund needle
solar hill
stoic dagger
#

Where is the Edit?

rotund needle
#

como ago para que funcione el sistema de puntos de recolecion

stoic dagger
#

I couldn’t find it.

edgy sinew
solar hill
edgy sinew
#

Like top of your screen literally of the window bar

cosmic dagger
cosmic dagger
rotund needle
#

How do I make a points system?

#

I tried to make a system but it works for me

cosmic dagger
#

Oh, that's a broad question . . .

stoic dagger
#

I couldn’t find it

#

Where’s the toolbar or the means edit

edgy sinew
cosmic dagger
#

Easiest answer is to create a class that stores points. When an event happens (where the player gains points), add X amount of points to the total points . . .

edgy sinew
cosmic dagger
cosmic dagger
tawdry valley
#

Hi, how can i make Don't starve camera rotation in unity 2d?

solar hill
#

now when you say camera rotation do you just mean a camera you can rotate every 45 degrees

#

or do you mean like a system that automatically updates sprites relative to the cameras position

#

so everything appears to be consistently facing the same direction relative to the camera

tawdry valley
#

actually i am still learning game dev so which one would work well?

wintry quarry
#

they would both work

solar hill
#

well the first one can be done within one script

wintry quarry
#

this is a question of how you want your game to work

solar hill
#

but the second one is a crazy amount of effort to get right

#

i did something pretty much exactly like that

stoic dagger
#

I find the edit

solar hill
#

its gonna involve a lot of animation states and transitions so youre pretty much gonna have to handle most of the animation updates through code for example

#

i used animancer

tawdry valley
solar hill
#

yeah the camera rotates at fixed 45 degree angles

stoic dagger
solar hill
#

smoothed it out so it looks seamless

stoic dagger
#

Which one

solar hill
#

but the sprites on the characters dynamically updates

#

so it appears as if they are always facing the same direction regardless of cameras rotation

keen summit
#

guys i'm having some trouble with my camera and i cant seem to figure out why, so as shown in the image below i got a player prefab which has a camera which follows the view of the FP camera (from cinemachine). now im trying to make it mutliplayer but everytime a client joins the game, my camera object gets his live camera (the camera it follows) set to the newly joint client, how do i fix this?

solar hill
#

that means for every animation you have you gotta have 8 more like it.

umbral pond
#

hi i need help with input actions 2D

solar hill
wintry quarry
#

or - only add them for the local player

keen summit
keen summit
wintry quarry
#

you're making a camera for the other players

#

and the camera is working

#

so that's what you see

umbral pond
#

im trying to do basic movement script adapted to new input system idk which functions to choose

wintry quarry
#

make them

#

then select them

keen summit
wintry quarry
#

(translate that to however your network framework does things)

tawdry valley
#

I deleted default inputaction file and create a new one. But i am receiving this warnings. How can i fix it?

umbral pond
#

i cant find functios from my script selection

wintry quarry
umbral pond
#

alright

#

ill try if it works

wintry quarry
#

looks like it's trying to read from an action asset that doesn't have the standard UI action map.

wintry quarry
umbral pond
#

yo it actually works

tawdry valley
wintry quarry
umbral pond
#

alright thank you

keen summit
tawdry valley
umbral pond
#

also i have a question

wintry quarry
wintry quarry
umbral pond
#

does someone knows how to variable jump height with new input system coding

wintry quarry
#

because that's what's giving the error

#

check your scene hierarchy

umbral pond
#

or is there any resource or video i can check

wintry quarry
#

once you get the input data, the code is the same

tawdry valley
umbral pond
#

i dont know old input one too so if i watch tutorial on old input variable jump height can i use it on new one too?

wintry quarry
edgy sinew
wintry quarry
edgy sinew
#

The main idea is you have to know “how long the button is held”

tawdry valley
wintry quarry
#

not the way he is doing it

edgy sinew
#

Okay, no he wouldnt

wintry quarry
tawdry valley
edgy sinew
umbral pond
#

aight

wintry quarry
#

so it would only happen if you have one

tawdry valley
#

i didn't understand 😄 i just created a canvas and eventsystem object appeared. And i remove inputsystem component on eventststem. Everything works now

wintry quarry
tawdry valley
rich adder
umbral pond
#

yooo

#

can i use this on new system

rich adder
umbral pond
#

Thank you

rich adder
#

thats just one of many ways it can be done

umbral pond
#

and

#

im not sure but i should add this interaction for jump right?

rich adder
wintry quarry
umbral pond
#

i made new action map asset

umbral pond
wintry quarry
umbral pond
#

i dont have something named gravityValue "float gravityValue = 3f;" would this be enough

#

i set my player's gravity to 3

#

also i dont PlayerVelocity but its just rb.linearvelocity right?

rich adder
umbral pond
#

alright

#

what about gravity value

rich adder
#

thats not important if you're using rigidbody already multiplied by Gravity if its on

umbral pond
#

should i just remove it then

#

"gravityValue" part

rich adder
#

its very simple
either do
rb.linearVelocity = new (move.x * speed, rb.linearVelocity.y)
//Jump
rb.AddForce( Vector3.up * jumpForce, ForceMode.Impulse)
or
rb.linearVelocity = new (rb.linearVelocity.x, jumpForce)

umbral pond
#

aight

#

can i ping you if i get an error

rich adder
#

You can post here and someone or me would likely see it, as long as you provide all proper context

umbral pond
#

alright

#

thanks for help

#

'InputAction' does not contain a definition for 'action' and no accessible extension method 'action' accepting a first argument of type 'InputAction' could be found (are you missing a using directive or an assembly reference?) im getting this error for this "if (jumpAction.action.triggered && isGrounded)" i hope translation is true

#

@rich adder

rich adder
#

public InputActionReference jumpAction; // expects Button

umbral pond
#

ill check it

rich adder
#

ActionReference lets you drag n drop actions from the ActionMap directly

stoic dagger
#

How to change under the grid colour ?

#

Those grey colour how to change it?

rich adder
umbral pond
#

is CharacterController component only for 3D?

stoic dagger
#

So I have to create another platform?

#

And than delete this project to refer a new project

rich adder
stoic dagger
#

Like open a new procedural skybox

rich adder
stoic dagger
#

How to do that

rich adder
#

then you assign that material in the Skybox field of the Lighting tab

stoic dagger
#

Fair enough thanks btw

umbral pond
#

i created 2D physics material made friction and bounciness to 0 wanted to add it to Player/BoxCollider2D/Material but i cant add it

#

oh its not 2D

#

mb

fervent bramble
#

Do yall have any recomendations for how to learn c# or whatever the f unity uses cuz i can follow tutorials only to an extent and they all sound like giberish to me

rich adder
#

!learn too

radiant voidBOT
fervent bramble
#

thanks

rich adder
#

these are the building blocks to most of everything you will be doing

fervent bramble
#

ok thanks

rich adder
#

Unity has its own API (functions and patterns) but harder to understand if you dont already distinguish between the two early on

fervent bramble
#

ok

#

!code

radiant voidBOT
fervent bramble
#

https://paste.mod.gg/civofmelllor/0 Error "Assets\Adam O'Keefe\FinalCharacterControler\Scripts\PlayerLocomotionInput.cs(6,72): error CS0426: The type name 'IPlayerLocomotionActions' does not exist in the type 'PlayerControls'"

rich adder
fervent bramble
#

I am following this tutorial https://youtu.be/muAzcpAg3lg?t=752

In this series, I'll be going over beginner through advanced topics for building a complete player controller, both for 1st and 3rd person. We'll covers topics like movement, jumping, slopes, wall handling, step handling, animation, blend trees, Mecanim, Cinemachine, avatar masks, animation layers and multiplayer.

This is a free complete course...

▶ Play video
wintry quarry
fervent bramble
#

oh it is named PlayerLocomotionMap

rich adder
wintry quarry
wintry quarry
#

He wrote IPlayerLocomotionMapActions here