#💻┃code-beginner

1 messages · Page 203 of 1

crimson sinew
#
  1. Did you save the code after you cut out the animation playing code?
  2. Is there some animation input that has the animation left over from being in previous runs or smth, idk
faint osprey
noble summit
#

why is networking so hard

timber tide
#

because you can't be lazy about your serialization and data coupling

polar acorn
#

Do you still have an animator on the object, and does that animator have a transition into the clip you were playing

turbid robin
#

i want to add a logo at the start at the application, near the unity one. is it possible? if yes how?
i am making an AR app, is it still posisble?

polar acorn
turbid robin
polar acorn
#

Project Settings -> Player

turbid robin
turbid robin
#

oh found it thx

eternal needle
# noble summit why is networking so hard

Most people in this channel would definitely recommend you dont do multiplayer as a beginner. This is like asking "why is flying a plane so hard" when you just learned to ride a bike. Some things are not meant to be done early on in your career and that's just the simple truth of it

turbid robin
polar acorn
#

also you can check the page I linked for what anything does

turbid robin
mortal bridge
polar acorn
#

you were not asking about cursors

turbid robin
#

i found that option under the icon, i need also the icon

#

why do i get this allert when i start the app?

eternal needle
# mortal bridge Definietly. Maybe try Coop local multiplayer first

Multiplayer is still multiplayer. Local coop is still gonna be harder than the basic game, since this is the beginner channel I wouldnt recommend any at all. It's still gonna require them to use mostly proper code architecture which most beginner tutorials do not follow

mortal bridge
#

local multiplayer

barren violet
mortal bridge
#

I think after junior programmer you are pretty much set to make simple games on your own getting help from Google

#

@barren violet

#

Do the bonus challenges. They teach you a lot (in my opinion)

barren violet
#

Ok cool. I look forward to gettting there

mortal bridge
#

and If you decide to take other pathways after junior programmer dont dive into it right away.

#

practice what you've learned from junior programmer first

mortal bridge
barren violet
mortal bridge
#

It is here my man

#

just google Junior programmer bonus car game

barren violet
#

Thx

eternal needle
summer stump
#

Plus it is walking you through how to do that specific game I would assume
Which would help, but not every game is the same

timber tide
#
[SerializeField] private UISlot UISlotPrefab;
//or
[SerializeField] private UISlot uiSlotPrefab;

What do you prefer for abbreviations with private fields?

zealous oxide
#

hey friends, i've read somewhere that instantiating numerous identical copies of a prefab from a game object, eg instantiating identical coins from an enemy when they die, is not hardware efficient, if that makes sense. what are the alternatives? is object pooling significantly better?

mortal bridge
#

an introduction

#

and they ask you to do this like one day after you start that pathway

#

so its not that hard its not that advanced stuff to make local coop

eternal needle
timber tide
#

yeah but feels bad so maybe the best thing to do is just rename it lmao

eternal needle
zealous oxide
#

I've got another question which i'm going to try my best to articulate. in a roguelite/like, when you have a load of items that affect a character in passive ways eg add a poison damage to an attack or give a character a stat it previously didnt have eg + 10 damage reduction, do those stats need be written into/exist in the initial character script so they can be modified by items down the line? so the stats already all exist within the character script but gaining the items then changes the stats/variables in question? I guess another way of articulating this is, is it possible to rewrite one script from another at runtime, assuming im not using scriptable objects (sorry if this is a bit confusing, im new here)

eternal needle
timber tide
#

you can pretty much give everything an ID and just write those if you wanted to

eternal needle
#

I just use enum which is basically the id

timber tide
#

Yeah, some identifier + lookup table

#

if you did have some like random stated weapons that generated with a range of stats, then you'd probably have to write those as their value types.

zealous oxide
# eternal needle This is just a matter of defining what the base stat is, and then adding to it b...

yeah the default value (0) is what i've done in my very first prototype but I didnt know if theres a better way to do it. its not really the items i'm worried about, its more about oh now I want this character to have an effect or on hit/kill effect it previously didnt have, does the action need to already exist within the script for it to happen or is there some way I can inject the variable, and then add it at specific points within the script at runtime

timber tide
#

scriptable object your kill effect and add a identifier

#

on load, lookup what the ID pertains to and construct your object again.

swift crag
#

I have a scheme that copies the SO's asset GUID into the SO

#
using UnityEngine;

#if UNITY_EDITOR
using UnityEditor;
#endif

public abstract class Identifiable : ScriptableObject
{
    [SerializeField] Guid _guid;
    public Guid Guid => _guid;

#if UNITY_EDITOR
    void OnValidate()
    {
        var path = AssetDatabase.GetAssetPath(this);
        _guid = new Guid(AssetDatabase.AssetPathToGUID(path));
    }
#endif
}
#

It uses a custom Guid class

#

System.Guid is non-serializable

zealous oxide
#

i got 1 more. is there a more effecient way of setting an enum from one script to another, than what i've had to endure here: (bear in mind the enums are exactly the same across the 2 different/separate scripts for the 2 different/separate gameobjects)

swift crag
verbal dome
zealous oxide
rich adder
#

doesnt unity have a GUID struct?

swift crag
#

are these two different enum types?

zealous oxide
#

no theyre exactly the same, but theyre in 2 different scripts and I cant work out a better way of doing it (im new to this)

swift crag
#

that means they're two different enum types

timber tide
#

assetpath is a string and that's kinda what I use

swift crag
#

you should just declare one enum type and use it in both places

timber tide
#

guid idea seems neat

swift crag
#

the GUID is nice because I can rename and move my assets without breaking existing save data

verbal dome
#

Yep

timber tide
#

I've it onvalidate

swift crag
#

Right, but existing save data now has the wrong asset path

#

The GUID is eternal.

#

(and fixed-size)

verbal dome
#

I also like to keep my OnValidate very lightweight or non existent

#

But sometimes its needed

swift crag
#

I'm not a huge fan of the giant pile of OnValidates, yeah

timber tide
#

yeaaah, something I was going to change eventually anyway

swift crag
#

I have another place where I can't really do that

#

I also use GUIDs to identify specific components in my prefabs

zealous oxide
swift crag
#

I have to manually click a "generate GUID" button on those

#

I guess I could check if the guid is all-zeroes in OnValidate

rich adder
verbal dome
rich adder
atomic yew
#

Hello, how can I activate an inactive object when I approach it with my character? without increasing fps?

verbal dome
swift crag
# zealous oxide ok this sounds like what i'm after
    public abstract class Module : MonoBehaviour, IConfigurable
    {
        /// <summary>
        /// Uniquely identifies an instance of a module attached to an entity.
        /// </summary>
        [SerializeField] public Guid guid;

#if UNITY_EDITOR
        [ContextMenu("Regenerate GUID")]
        void NewGUID()
        {
            var so = new UnityEditor.SerializedObject(this);
            so.FindProperty(nameof(guid)).boxedValue = (Guid) System.Guid.NewGuid();
            so.ApplyModifiedProperties();
        }
#endif
verbal dome
#

Hmm or not

swift crag
#

I love casting from System.Guid to Guid

languid spire
swift crag
#

that's not very intuitive

polar acorn
swift crag
#

you mean disabled components?

rich adder
zealous oxide
swift crag
#

an inactivated gameobject can't possibly collide

swift crag
#

wrong reply, my bad

#

was aiming at Osmal

polar acorn
#

Just triggers though

verbal dome
#

Really?

#

That sounds terrible

#

Are you sure you're not thinking of inactive components?

languid spire
#

no, it's Unity standard for waking up sleeping objects

polar acorn
atomic yew
verbal dome
#

It does say somewhere in the docs that it's meant for exactly what steve said

#

I can't find it

atomic yew
swift crag
verbal dome
#

something something in response to colisions

swift crag
#

Because this is true for disabled behaviours

#

Behaviours are disabled. Game objects are deactivated.

swift crag
#

Disabled behaviours still receive a bunch of Unity messages

polar acorn
#

Okay, yeah, you guys are right, if the object is disabled, no message. But it does work on components that are disabled

verbal dome
#

Ah found it

Collision events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions.

steel smelt
#

If you disable a GO in a physics callback or during a physics timestep, that GO can still be hit by physics queries until the actual update has happened

swift crag
#

it's useful to keep the terms separate to avoid confusion

polar acorn
swift crag
#

Oh, I misunderstood your message.

#

That's a corner case I haven't really looked into myself!

#

(I missed the "queries" word :p )

steel smelt
#

😄 Yeah it's a pain, it means you need to maintain the state and can't rely on object's active state for the hit logic

verbal dome
#

Or does that suffer from the same thing

steel smelt
verbal dome
#

I'll keep that in mind nevertheless - thanks

rich adder
#

hmmm not sure if its related, weird... unity lets you run methods on referenced script on disabled objects

languid spire
verbal dome
rich adder
swift crag
#

That's an important thing to realize.

languid spire
#

generally the only things that don't run on a disabled object are Awake, OnEnable, Start, Update etc. The Events will all still be invoked

swift crag
#

Also, you can call methods all day on a destroyed Unity object

#

If you have a reference to a destroyed Unity object, you can do whatever you want with it

#

You will get errors if you try to use a Unity property.

scarlet skiff
#

is there a way to get the position of the where the middle of the camera is?

scarlet skiff
#

or i suppose the cameras local 0, 0

swift crag
#

But beyond that, Unity can't "destroy" the actual C# object

verbal dome
#

I forgot, is an UnityEngine.Object == null when it's being destroyed?

swift crag
languid spire
swift crag
verbal dome
swift crag
#

and there is no null

verbal dome
#

Camera.ViewportToWorldPoint(0.5f, 0.5f) is handy for screen space center

scarlet skiff
#

idk much about world space and screen space

swift crag
#

yes, Viewport space is resolution-independent, so it's easier to reason about

#

well, you'd better be ready to learn!

languid spire
rich adder
timber tide
#

that's a fun one

verbal dome
swift crag
#
  • World space: a position from the point of view of the world. It is independent of your choice of parent.
  • Local space: a position from the point of view of yourself
  • Screen space: [0,0] to [width, height]. Z is the depth, measured in meters
  • Viewport space: [0,0] to [1,1]. Z is the depth, measured in meters
verbal dome
#

Yeah that's a more valid explanation

swift crag
#

Your transform.localPosition is your position in your parent's local space

#

If you have no parent, then transform.position is transform.localPosition

scarlet skiff
rich adder
scarlet skiff
#

and world space is well, just the worlds cords independ on what goes on

verbal dome
#

And Camera class has methods to convert between world space, screen space and viewport coordinates

atomic yew
polar acorn
wind raptor
#

Is one of these better than the other, performance wise? As in, is there a good reason to keep the buffer global (I do not need to track the buffer elements between function calls)

void doThing()
{
    byte[] buffer = new byte[1000];
    // do stuff with buffer
}

As opposed to

byte[] buffer = new byte[1000];
void doThing()
{
    // do stuff with buffer
}
languid spire
#

how often to you call doThing?

swift crag
#

The first one allocates every time you call doThing.

verbal dome
#

Which would produce garbage

atomic yew
swift crag
#

I've gotten major GC reductions by moving a List<T> out of a method and into the class

wind raptor
swift crag
#

and just clearing it each time I need to use it

polar acorn
sharp wyvern
swift crag
languid spire
swift crag
#

unless this method is only ever called very very infrequently

wind raptor
#

Pretty frequently

#

Okay, thanks

swift crag
#

You'll be holding onto that array forever, sure, but holding onto memory is way better than allocating and freeing it over and over

sharp wyvern
#

either you have the memory allocated all the time, or you spend time allocating it each time.. how is that not a trade off?

swift crag
#

because garbage collection is a huge performance consideration

#

the time taken to allocate the array is secondary to all that trash you're producing

sharp wyvern
#

GC counts as "time"

swift crag
#

I'd say it's more memory-heavy to be producing garbage

#

it puts more pressure on the allocator

languid spire
verbal dome
#

If you allocate a new one every frame time, you might be consuming more memory, right? If it is called often

atomic yew
verbal dome
#

Since it stays in memory until it's collected

timber tide
#

my ide yells as me when I don't make nonalloc containers for casting each frame

#

so I must do what it says

swift crag
#

It's both slower and more abusive of your heap to allocate constantly

#

A temporary allocation only wins if the method is used so rarely that there are usually no allocations

verbal dome
#

Could always set the array to null when you know you won't use it in a while

swift crag
#

this does remind me of something

#

I have an AI planning system that generates a lot of garbage

verbal dome
swift crag
#

It's doing A* and has to generate a bunch of nodes as it explores

#

When it's done, every single object it allocated is thrown out

#

I'd love to be able to put this all in a scratchpad that I dispose of at the end

swift crag
#

Yeah, I might just do object pooling.

#

Each state contains several hash sets to hold world-state

wind raptor
#

Secondary question. If I opt for a global, persistent array, are there any performance considerations (not memory, not too concerned about that in this instance) for grossly oversizing it? Making it 4000 bytes, say

swift crag
#

The objects the hash sets store are all value types

swift crag
wind raptor
swift crag
#

I know that you can use a temp allocator with NativeArray, but that's not helpful here, since I'm using managed types

swift crag
#

This is basically what a List<T> does.

#

maybe you should just use a list!

verbal dome
#

I should probably start initializing certain lists with a capacity

swift crag
#

All of these hash sets and dictionaries are storing value types

verbal dome
#

If I know the approximate maximum items for them

swift crag
#

and those value types are storing primitives like float

sharp wyvern
# wind raptor Why?

this will force it internally to be exactly aligned in memory.. e.g. if your size is 4096 you can specify an index with exactly 3 bytes

swift crag
#

Maybe I can just allocate a big pile of NativeHashSet and NativeHashMap with the temporary allocator

#

at that point I might as well bite the bullet and completely Burst this thing

stoic relic
#

Is there anyone that can help me with a terrain generation script? (I'm new to unity and game dev in general so I'm not exactly sure what kinda questions to ask)

outer cobalt
#

if i stay still, everything is fine, then when i move the box colliders, rigidbody ect get set to None and it gives me the error Object reference not set to an instance of an object

verbal dome
outer cobalt
verbal dome
#

Terrain generation is not exactly a beginner subject though, at least for your first game

#

Popularity of MineCraft etc got people thinking that it's easy I guess

languid spire
eternal falconBOT
outer cobalt
#

okay bugfixing this myself (i am learning) it has to do with my Animator

outer cobalt
stoic relic
# verbal dome Plenty of helpful people here, but we need a question to be able to answer

cool - I had a terrain generation script working for a minecraft-esque game (I know - why the hell is a beginner working on this) and it worked on a single thread but had a level of detail system implemented where it merges blocks further away into a single bigger block. I've now tried to multi-thread this by using Burst and nativearrays and I currently have a single persistent array that's causing a leak but I can't exactly dispose of it at any given point.

verbal dome
#

I haven't really worked with Burst though - can't help with that, maybe someone else will

stoic relic
#

I've got tons of it but never in the gaming area - I work as an .NET dev otherwise for work

verbal dome
#

(Burst caused random crashing on my non-LTS unity, only took me 1 year to find the cause 🙃 )

stoic relic
#

I'm so sorry to hear that 🥲

outer cobalt
#

would it be better if i handled animations in another function?

stoic relic
outer cobalt
stoic relic
#

if isDev && isBeginnerSupposedly is why I thought it was supposed to be here, but thanks!!

stoic relic
#

I feel like such a noob when it comes to gameDev 🥲 - I've now jumped engines 3 times and barely progressed 😄

stoic relic
verbal dome
#

In any case having prior C#/.NET experience is a huge boost for a beginner

stoic relic
languid spire
outer cobalt
#

when my animation changes, it gives me a Object reference not set to an instance of an object I referenced the anim and i did a getcomponent and it still doesnt work

mortal bridge
#

why does my saved animation conditions keep disappearing everytime I enter the project?

outer cobalt
#

the Animator is connected to the player

outer cobalt
#

and even in the start i did a anim = GetComponent<Animator>();

mortal bridge
#

I save it

#

I quit my project. Reenter. Boom gone

rich adder
#

strange..

#

are u in playmode changing ?

languid spire
mortal bridge
outer cobalt
mortal bridge
#

Also

outer cobalt
polar acorn
outer cobalt
#

122 and 107

#

error on top

polar acorn
rich adder
outer cobalt
languid spire
mortal bridge
polar acorn
outer cobalt
rich adder
outer cobalt
#

is it not because im using multiple frames now due to using pixelart?

polar acorn
# outer cobalt

The full object's inspector. You can go ahead and collapse this one since it's quite big to show the rest of it

polar acorn
outer cobalt
polar acorn
languid spire
outer cobalt
mortal bridge
#

by pressing that plus sign

rich adder
#

great Microsoft has renamed Bing Chat to Copilot .....

languid spire
#

probably just need to remove

anim = GetComponent<Animator>();
polar acorn
outer cobalt
#

But i set the animator?

polar acorn
#

That would be why anim is null because you're setting it to null in Start

rich adder
mortal bridge
languid spire
polar acorn
mortal bridge
#

it basically changes itself

#

code is an if staement so shouldnt matter its just for playing it

#

the conditions I set keep disappearing after I re enter my project its really frustrating

outer cobalt
#

i am so confused

mortal bridge
#

I had 2 for death. But when I reentered I saw that it didnt play then I checked everything for half an hour then saw that conditions was reset

polar acorn
outer cobalt
#

i removed that line

#

it still gives the same error

#

and now i set the anim in my script to the proper anim

languid spire
# outer cobalt i am so confused

why, you set the Animator correctly in the inspector but set it incorrectly (to null) in Start. So just dont do it in Start like I said

polar acorn
outer cobalt
#

hold up, its also giving me errors that my parameters do not exist lmfao?

polar acorn
#

Show updated code and new errors

mortal bridge
#

since you are helping the guy with animations can you help me too?

outer cobalt
#

NullReferenceException: Object reference not set to an instance of an object
PlayerMovement.updateAnimationParameters () (at Assets/Scripts/PlayerMovement.cs:121)
PlayerMovement.Update () (at Assets/Scripts/PlayerMovement.cs:106)
NullReferenceException: Object reference not set to an instance of an object
PlayerMovement.FixedUpdate () (at Assets/Scripts/PlayerMovement.cs:140)

#

its also weird that its not saying my parameters exist but i guess that because the script is still seeing it as "null?"

polar acorn
outer cobalt
#

bruh i pasted it

rich adder
#

did u save ?

verbal dome
outer cobalt
#

💀

polar acorn
#

And also rb is null for the second error

outer cobalt
#

how is rb also null when i set it in the inspector

mortal bridge
#

@rich adderDo you have a solution?

polar acorn
verbal dome
#

They should save even in play mode

devout flume
#

When you build something, and then import it as a prefab: how can you check the components of that prefab, without having to place it back?

If you can't do that, what happens if you put the prefab in the hierarchy, modify its components, and place it back in the project assets, wouldn't it prompt issues with references you made?

rocky canyon
#

u can double click the prefab and it'll open the prefab in its own window

#

all references a prefab has should either be inside the prefab itself.. or they need to be assigned during runtime after the prefab is instantiated into the scene (using coding)

#

you can't use a reference to something in teh scene w/o the references having errors

devout flume
rocky canyon
#

no prob

outer cobalt
#

@polar acorn this never used to be a error, i copied it over from another object, i switched art styles and im now doing PixelArt which uses multiple frames, is it not because its switching frames it doesnt see the original RB or anim anymore?

polar acorn
#

Find out where you have a PlayerMovement that is missing one or both of these assignments

rich adder
polar acorn
#

Errors do not lie. If the code says something's null there, something's null there. Check your own assumptions for why you think that can't be the case because it is always the human that is mistaken and never the error

outer cobalt
#

i dont see it hahahaha

polar acorn
lusty socket
#

!code

eternal falconBOT
outer cobalt
queen adder
#

the tutorial im following works but mine doesnt

rocky canyon
#

thats cuz its misspelled bro

queen adder
#

what

rocky canyon
#

check the code again

queen adder
#

alr hold on

rocky canyon
#

and its odd that ur using a GetKeyDown for a mouse button..

queen adder
#

hopefully i get better but rn idk anything

rocky canyon
#

normally you'd see GetMouseButtonDown

      if(Input.GetMouseButtonDown(0))
        {

        }```
queen adder
#

huh

rocky canyon
#

well ya, just check ur spelling

queen adder
#

might try that instead

rocky canyon
#

ur original code should be fine.. only its misspelled

queen adder
#

well it was spelling thank you

rocky canyon
#

c# is case sensitive

#

Update() is not update() etc

mortal bridge
#

wait

rocky canyon
#

you apparently dont have that variable

rich adder
mortal bridge
#

I have this

#

sorry for deleting and reposting. I had to change some things

polar acorn
queen adder
#

alr thank you for the help

rocky canyon
#

using a b d etc is confusing.. if you tend to share the code often try to use some better naming

rich adder
# mortal bridge

hmm changing it here will not affect the original Animator Controller

mortal bridge
#

exactly

swift crag
mortal bridge
#

It reset again

mortal bridge
#

While I was in unity

outer cobalt
#

wasnt even that

rich adder
# mortal bridge While I was in unity

try to recreate a new controller ? I'm not sure why it would be happening, the controller is an asset so just chaning in editor would affect it unless u had code changing that somehow

verbal dome
#

I'm completely rewriting my AI currently 🫠

#

Well, the core of it

swift crag
#

yeah, that's what's going on here

mortal bridge
swift crag
#

I'm doing a GOAP ™️

#

so far the enemy can actually plan to move to the player and perform a multi-step attack

rich adder
#

im dreding goap rn 😭

verbal dome
#

Any good learning resources? I kinda semi-freehanded it and never finished it

mortal bridge
#

note: my Unity version is the latest

rich adder
broken trellis
#

I hate compiler errors. I couldn't find the code unlocker, and had to delete my entire project

mortal bridge
verbal dome
#

I'm migrating to using purely data-based agents so that I can test their behaviour and cooperation in edit mode

swift crag
#

it can reason about:

  • atomic facts (e.g. "I like making things unalive")
  • entity facts (e.g. "The player is alive")
  • entity proximity facts (e.g. "I want to be within 2 meters of the player")

One thing I can't do right now is delete facts. that's going to be exciting

rocky canyon
#

you should use LTS versions for the best support.. but yea probably doesn't matter what version you're using

mortal bridge
#

The animations were made in an older version but should work just fine.

outer cobalt
#

Turns out that it doesnt like me just replacing something straight up, i had to readd the sprite

rich adder
outer cobalt
#

it was not seeing the player straight up

#

didnt have to do with the code

mortal bridge
#

If we can't fix it

outer cobalt
#

thank you guys for helping, learned lots, thanks for not just telling me the awnser

rocky canyon
#

if its a bug it'll probably have already been ticketed

rich adder
outer cobalt
#

especially digi, thank you friend

brave valve
#

Hello, I have a problem.
I have a JSON like this:

{
users: [{...}, {...}]
}

Each of these objects in the array have this schema:

  • name: string
  • age: int
    Now I want to apply it to the class Users, so I did that:
struct User {
 public string name;
 public int age;
}

class GameData {
 public User[] users;
}

GameData game = JsonUtility.FromJson<GameData>(rawJson); // rawJson is the json in plain text

But now when I log game.users it returns null. Please help me 🙏

swift crag
#

The "aha" moment for me was realizing that A* doesn't need a fixed list of nodes. It just needs you to give it new nodes to explore!

broken trellis
mortal bridge
rocky canyon
#

no.. you'd have to try your project

#

on a different version..

rich adder
rocky canyon
#

to rule out its not ur stuff

verbal dome
timid hinge
#

Hi guys, sorry for being annoying, does anyone know how I can fit these dungeon rooms into just one square?

broken trellis
#

I read something about scripts getting "Locked" in VS Code

timid hinge
#

like this

polar acorn
rich adder
mortal bridge
swift crag
broken trellis
mortal bridge
#

not my first time

polar acorn
broken trellis
polar acorn
broken trellis
brave valve
# rich adder u need to show the full context
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using UnityEngine.UI;
using System.Linq;

public struct Element {
    public int placement;
    public string type;
    public int x; // spike, 
    public int z; // spike,
    public float delay; // all
    public string size; // spike,
    public float duration; // spike,
    public bool boolo; // all
}

public class LevelData
{
    public string name;
    public int sx;
    public int sz;
    public List<Element> timeline;
}

public class GameStart : MonoBehaviour {
    public Text levelName;
    public GameObject floor;
    public LevelData level;
    int time = 0;

    void Start() {
        level = ReadLevelFile();
        levelName.text = level.name;

        Debug.Log(level.timeline) // "null" is here
    }

    LevelData ReadLevelFile() {
        string filePath = "Assets/Scripts/level.json";

        if (File.Exists(filePath)) {
            string json = File.ReadAllText(filePath);
            LevelData level = JsonUtility.FromJson<LevelData>(json);
            return level;
            
        } else {
            Debug.LogError("File not found!");
            return null;
        }
    }
}

I simplified the code for discord but here is the full code, and the JSON:

{
  "name": "Tutorial",
  "sx": 7,
  "sz": 7,
  "timeline": [
    {
      "placement": 2,
      "type": "spike",
      "x": 0,
      "z": 0,
      "delay": 2,
      "size": "big",
      "duration": 3,
      "boolo": true
    },
  ]
}
broken trellis
#

Or Unity mb

rich adder
broken trellis
#

I mainly came here to grieve the loss that I got throwing all that work away, but also hoping if the future that maybe I could get help with errors like this?

mortal bridge
#

Do you guys mind taking a look at my project?

brave valve
gray pond
#

hi peeps, going through a C# tutorial rn to learn the language and i don't get the difference between float, double and decimal

#

would somebody mind explaining it to me like a 5 year old?

#

lol

rich adder
#

!code

eternal falconBOT
rocky canyon
#

as a beginner you'll probably be fine just knowing a float is a decimal

shell sorrel
brave valve
rocky canyon
#

all the other types are for more advanced things

gray pond
#

ok no worries

mortal bridge
#

please

shell sorrel
#

unity uses float for pretty much everything, and rarely does double

rocky canyon
gray pond
#

gotcha

shell sorrel
#

same goes for short int long

#

just stick to int

brave valve
gray pond
#

idek what short or long is, they didn't mention it 💀

rich adder
gray pond
#

oh boy

mortal bridge
#

@gray pondjust be mindful about arrays when using float

gray pond
#

i'll learn eventually

gray pond
rocky canyon
#

i dont think u can have an index of float..

rich adder
mortal bridge
rich adder
#

eg if your map is hugeeeeee

brave valve
rocky canyon
#

0, 1, 2 * 😈

brave valve
#

everything else is fine

mortal bridge
rocky canyon
#

lol no worries.. computers count from 0

shell sorrel
rocky canyon
#

lol.

rich adder
#

game.users

mortal bridge
#

@gray pondarray is storage

#

easy

brave valve
#
void Start() {
        level = ReadLevelFile();
        levelName.text = level.name;

        Debug.Log(level.timeline) // <------- it logs null
    }
mortal bridge
#

so Is there a volunteer who would take a look at my project?

shell sorrel
brave valve
#

but game.users was just a simplified version for the code on discord, level.timeline is the real full code

shell sorrel
#

its a list and those start as null unless you create one

brave valve
slender nymph
mortal bridge
#

@slender nymphI already did. I think you come just now

shell sorrel
brave valve
slender nymph
rich adder
shell sorrel
brave valve
#

How do I mark [Serializable] on Element

#

oh ok

#

I'll try

shell sorrel
#

[Serializable]

mortal bridge
shell sorrel
#

put it above all the structs and classes you are using with JsonUtility

rich adder
mortal bridge
rocky canyon
#

4 scripts all modifying 1 animator controller? 👀

rich adder
mortal bridge
shell sorrel
mortal bridge
#

3 for other things

shell sorrel
#

feel like i would have one component interacting with the animator that other things call on to do work

rocky canyon
#

disable the script thats modifying the animator and see if u still have issues? that would eliminate the script as the culprit?

mortal bridge
#

Already tried that.

rocky canyon
#

and wat was the outcome?

#

did it still have problems?

#

or did the problems dissapear

brave valve
# shell sorrel `[Serializable]`
[Serializable] public struct Element {

-> Assets/Scripts/GameStart.cs(8,2): error CS0246: The type or namespace name 'Serializable' could not be found (are you missing a using directive or an assembly reference?)

mortal bridge
#

Yes. I wouldn't be here otherwise

mortal bridge
#

I don't think it has something to do with the script

brave valve
#

ok thanks 🙂

rich adder
rocky canyon
mortal bridge
#

Well if you could take a look at my project I'd appreciate it

mortal bridge
#

I tried it in an older version way before

#

It worked fine

rocky canyon
#

then your solution may be to use a different version

rich adder
#

before is not now though 😛

brave valve
#

It's working now! Thanks @rich adder and @shell sorrel for the help 🙂

rocky canyon
#

ya, i wanna guess that you've added to ur project since then...

#

u cant use that as a comparison if its not exactly how it is now

raven hill
#

Does anyone understand why my player doesn't jump?

rich adder
#

maybe something is messing with the isDirty or something

#

idk much about editor stuff though

rich adder
mortal bridge
rich adder
#

I think if you add Impulse it will work

mortal bridge
#

maybe if you guys took a look at my project but... anyways

rich adder
raven hill
rocky canyon
#

impulse might fix it

brave valve
#

@rich adder just last question: why [Serializable] resolved the problem? Because I put that but I don't know why...

rich adder
mortal bridge
shell sorrel
brave valve
rocky canyon
rich adder
mortal bridge
rocky canyon
#

not saying ur a scammer or anything.. but it happens and people are hesitant to do it

rocky canyon
#

that'd be my suggestion

mortal bridge
#

well yeah I am a scammer you got me! Hello this is Unity tech support how may I assist you today?

rocky canyon
#

since u said it works in another version. that might be the only thing u can do..

#

or in the unity hub u can swap the version ur using to open it

#

that'd be the easiest way

#

duplicate the project folder first so if things go bad ur project isnt ruined..
and with the new project just open it with a diff version

rich adder
#

tbh testing the same project (a copy) on a different unity version is your best sensible bet rn @mortal bridge

rocky canyon
#

mmhmm.. and if it works in that new version.. then u can send in a bug report

#

if u believe its the version thats bugged (which if it works on a different version may very well be the case)

#

but like nav said, a copy of this most recent version..

#

not the older version u said worked b4

mortal bridge
#

Okay. I have big concerns about version change since some of my shaders were ruined but let me do it. You guys make me face one of my biggest fears

#

yeah a copy

#

yes a copy i can do it

rich adder
#

You should always do it on copies, and regardless You shouldprob have GIT setup with repo

iron mango
#

hey! what is the best way to create health bars for enemies? what i mean is, to show the healthbars on screen, you first have to identify that they are visible on screen. i think to constantly loop through all enemies is not it xD

mortal bridge
#

I am very proud to announce that when I tried this in the earlier version I used to work with it worked (at least for now I quit and reentered it was fine) I am proud to be one of the bug finders

rich adder
mortal bridge
#

latest

rich adder
#

latest isnt a version

mortal bridge
#

two thousand twenty two. three. nineteenf one

#

2022.3.19f1

rich adder
#

not the latest 😛

#

but yeah sure

#

i never use "the latest"

#

always find weird bugs

mortal bridge
#

they be updating quick

rich adder
#

they better be

#

its LTS

mortal bridge
#

time to report some bugs baby. better reward me for it. like dont get revenue share or money per install from me

rich adder
#

funny

raven hill
#

Does anyone know why the monkey just disappears?

eternal falconBOT
rich adder
#

check the layer order anyway

slender nymph
#

it's also clearly not disappeared. it's most likely behind some other object, like your background

raven hill
#
using System.Collections.Generic;
using UnityEngine;

public class MonkeyScript : MonoBehaviour
{
    float targetPositionX;
    [SerializeField] private float speed;

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

    }

    // Update is called once per frame
    void Update()
    {
        targetPositionX=GameObject.FindWithTag("Player").transform.position.x;
        float step = speed * Time.deltaTime;
        transform.position = Vector2.MoveTowards(transform.position, new Vector2(targetPositionX, 0.2f), step);
    }
}```
rich adder
#

its probably the Order layer though

zealous oxide
#

hey friends, i'm still stuck on my enum issue from earlier. i've got 2 classes with an identical declared (within each class) enum and I want 1 class to set the enum on the other class to match whats in the first one without having to write out each individual change, so it would be more like "spawnedDotZonePrefab.GetComponent<AOEDamageScript>().debuffType = this.DOTZoneControllerScript.debuffType;" but ofc this code doesnt work and i'm not sure what it is exactly i'm looking to type in here for the bit after =

rich adder
#

and have other enum class listen to it

public MyEnum MyEnumValue
    {
        get { return _myEnumValue; }
        set
        {
            if (_myEnumValue != value)
            {
                _myEnumValue = value;
                OnMyEnumValueChanged?.Invoke(value);
            }
        }
    }
raven hill
zealous oxide
buoyant knot
#

that’s why he is explaining it to you

rich adder
#

but they run everytime you access the prop

buoyant knot
#

you need to understand properties to use C# anyway

#

it’s a core part of the language

quick pollen
#

so I have this

#

i wrote this to experiment with something

#

and for some reason in the inspector, the value of landed is flickering??

buoyant knot
#

maybe isGrounded is flickering

rich adder
buoyant knot
#

this is another situation where I would use a property and not a field

quick pollen
#

what I want basically

rich adder
#

I would make my own grounding

signal cosmos
rich adder
#

like Sphercast or whatever

wintry quarry
#

but yeah CC.isGrounded isn't the best.

quick pollen
quick pollen
buoyant knot
#

public bool Landed => !_controller.isGrounded;

quick pollen
#

what I want is to not be able to bhop

#

like basically whenever I land on the ground

#

I want the "Jumping" input axis to be reset somehow

rich adder
wintry quarry
#

use your own grounded check

quick pollen
#

otherwise it works fine

wintry quarry
#

CC.isGrounded is only true when your last CC.Move call pushed it into the ground

#

this trips people up all the time

buoyant knot
#

use your own grounded check

quick pollen
#

dang thats stupid

mortal bridge
rich adder
polar acorn
quick pollen
buoyant knot
#

i feel like I have to repeat his advice because it is not heeded notlikethis

rich adder
#

like SimpleMove method which uses gravity, but really who uses that 😂

mortal bridge
#

first time hearing

rich adder
signal cosmos
buoyant knot
#

code with big documentation

rich adder
buoyant knot
#

comments go big big

quick pollen
median ruin
#

What does this mean... I literally pulled the script to the gameObject?

quick pollen
#

i know theres a function to reset all input axises

#

which would actually be good

rich adder
buoyant knot
#

///<summary>Docstring </summary>

median ruin
final kestrel
#

How often do you guys implement the observer pattern in your codes?

rich adder
#

then you have compile errors

polar acorn
rich adder
#

so yeah every project lol

buoyant knot
#

like, a lot a lot

quick pollen
median ruin
verbal dome
#

Events are good, just gotta remember to unsubscribe if needed

rich adder
#

honestly after you get a hang of events you never want to go back

buoyant knot
polar acorn
signal cosmos
verbal dome
#

They seemed a bit intimidating at first, but they really aren't

final kestrel
#

Ah okay thanks for the answers.

buoyant knot
#

events are an easy way to satisfy the open/closed principle

broken trellis
#

{
if(Input.GetMouseButtonDown(0))
{
target = Camera.main.ScreenToWorldPoint(Input.mousePosition);
target.z = transform.position.z;
}
}

Newby here. Any quick way to make this a core routine?

buoyant knot
#

what is a core routine

final kestrel
#

I am then making it my priority to learn now.

rich adder
verbal dome
signal cosmos
buoyant knot
#

delegates can get complicated. Actions are simpleish

broken trellis
quick pollen
#

why cant i cast a bool to be an int like this?

median ruin
rich adder
#

(int)

polar acorn
verbal dome
quick pollen
#

oh im stupid

verbal dome
#

But you can't cast a bool to int

quick pollen
#

right

#

thanks

#

wtf why

quick pollen
#

like in c++

final kestrel
#

It is kind of hard to wrap my head around events. I watch videos I understand why but never done it myself yet. I wondered if it is widely used.

rich adder
#

just make ur own function that does it

verbal dome
#

🤷‍♂️ You can do int myInt = myBool ? 1 : 0

quick pollen
#

true

#

I just didnt wanna resort to ternary operator

rich adder
#

thats like saying "i dont want to resort to if else statement"

quick pollen
verbal dome
#

Alternatively a function int BoolToInt(bool b) or something

#

But seems excessive iIMO

buoyant knot
# median ruin Where do you use events?

Let’s say I am loading a level file. My SaveHandler class will invoke an event OnLevelLoad to call anything that needs to be called when a level has just been loaded.

mortal bridge
#

only madmans do that

rich adder
#

regardless you still need return the if else no ?

buoyant knot
#

Or SpawnedEntityHandler invokes OnEntityDeath to call anything that must be called when a given entity dies

quick pollen
#

my main problem rn is the bhopping

broken trellis
buoyant knot
#

Or PlayerMovement invokes OnPlayerJump to let anything know that the player has just jumped.

quick pollen
#

because i dont want it to be able to bhop

#

how could I fix that?

verbal dome
#

Bunny hop?

buoyant knot
#

back hop?

summer stump
#

Misspelled for bop i think

buoyant knot
#

big hop?

polar acorn
quick pollen
#

continuous jumping

verbal dome
earnest atlas
quick pollen
#

i have a video above

#

which explains it

dense cypress
#

https://gdl.space/vebofequju.cs

First person player controller, except for whatever reason W and D move me one direction (not relative to player) and A and S the other

quick pollen
#

but ill re-record it then

verbal dome
buoyant knot
# median ruin hmm okay

generally, when a class does something that might cause other things to need to happen, BUT this class isn’t actually responsible for doing any of those things, you want to use an event

verbal dome
#

What do you not want to happen?

buoyant knot
#

wtf is a bunny hop

median ruin
shell sorrel
verbal dome
final kestrel
#

So, when I trigger the exit. The exit fires off an event and the scenemanager subscribes then loads the next level?

mortal bridge
quick pollen
#

if you hold down jump, the character can just keep on jumping

#

i want it to have a small cooldown whenever it lands

earnest atlas
#

How do you handle detection if a button is pressed?

summer stump
#

So nothing like the classic bunny hop from quake

polar acorn
earnest atlas
#

New system or old?

dense cypress
quick pollen
buoyant knot
mortal bridge
shell sorrel
#

oh because you called it that thought he was talking about quake/source stuff

quick pollen
#
        if (Input.GetAxis("Jump") >= 1 && jumpTime > 0f && Input.GetAxisRaw("Horizontal") != 0)
        {
            isJumping = true;
            gravPull.y = Mathf.Sqrt(_jumpHeight * _gravity * -10f);
            jumpTime -= Time.deltaTime;
        }```
buoyant knot
#

i think he means double jumps

verbal dome
dense cypress
quick pollen
summer stump
verbal dome
quick pollen
mortal bridge
shell sorrel
#

jumo should not be a axis

#

use Input.GetButtonDown for it

buoyant knot
earnest atlas
# quick pollen old input system

you can probably have bool that saves if jump was pressed and if jump is pressed and that value is too return instead of doing jump code.
when jump is not pressed just set the JumpPressed value to false back

quick pollen
polar acorn
#

This is trying to use a hammer on a screw

summer stump
#

They want to HOLD jump, and when they land there is a cooldown before jumping again.
Right Alfy?

polar acorn
#

it's just not the tool for that

shell sorrel
#

so on becoming grounded start a timer

buoyant knot
quick pollen
#

well the old input system has the whole Sensitivity thing

#

and i thought itd be useful

#

so i dont have to write fucked up code

earnest atlas
#

old system is fine

summer stump
buoyant knot
#

i’ve never heard it called a bunny hop, since idk of any games that actually want you to continuously jump by holding jump. I’ve seen it before, but I don’t think it is intentional.

#

you should be using the new input system, with invokes events on button presses

quick pollen
# summer stump What sensitivity thing?

basically we know that the old input system just interpolates between 0 and 1 whenever hold down a key
sensitivity is for telling it how long it takes for it to go from 0 to 1

verbal dome
#

But I might be wrong

quick pollen
#

and I was shamed for trying to use it and was asked why didnt i use the old one

summer stump
earnest atlas
#

cause its really different from old one

mortal bridge
#

float moveX = 0;
float moveZ = 0;

if (Input.GetKey(KeyCode.W)) moveX = moveX+ 1;
if (Input.GetKey(KeyCode.S)) moveX = moveX- 1;
if (Input.GetKey(KeyCode.A)) moveZ = moveZ- 1;
if (Input.GetKey(KeyCode.D)) moveZ = moveZ+ 1;
moveDir = transform.forward * moveX + transform.right * moveZ;
@dense cypress

quick pollen
buoyant knot
verbal dome
quick pollen
buoyant knot
#

it should be simple to slowly transition, replacing calls to the old input system with calls to the new input system

verbal dome
#

If you got errors i'm sure those are fixable

summer stump
#

Use Old input. No need for new unless you want jt

quick pollen
buoyant knot
#

yeah, that is not normal behaviour

verbal dome
buoyant knot
#

again, this is not normal

quick pollen
#

yeahh i could tell

mortal bridge
#

@dense cypressThis solved it?

quick pollen
#

so my experiences with it are bad

summer stump
earnest atlas
#

mixing both will make so new one will work funiky

quick pollen
#

and I understand the old system much better anyway

buoyant knot
#

adding the plugin should not break anything

dense cypress
summer stump
mortal bridge
quick pollen
earnest atlas
#

New one is much better

mortal bridge
quick pollen
timber tide
#

new one sucks for mouse so I use both

buoyant knot
summer stump
quick pollen
#

all good :)

verbal dome
quick pollen
#

i know its probably better

buoyant knot
#

idk wtf you did. are you sure you used the Unity input system package?

quick pollen
#

lemme rephrase
"I have a better understanding of the old system anyways"

quick pollen
#

but it doesnt matter anyway

buoyant knot
#

you should try to get it working, dude

#

it will make your life easier

quick pollen
#

it overwrote the old one

buoyant knot
quick pollen
#

well idk wtf was up with it

#

but I spent like 2 days trying to fix it back then

#

and ended up having to create a new project

buoyant knot
#

back everything up, and try again

earnest atlas
#

I have no idea how he broke everything with unity import

buoyant knot
#

i honestly doubt it. it is a package

earnest atlas
#

I bet he never opened systemEvent

quick pollen
#

tbf me neither but i cant say im surprised

dense cypress
quick pollen
#

anyhow

#

im really not sure how to go about fixing it

#

I was thinking of adding it as a feature

mortal bridge
#

relative to player that code does it alright already

quick pollen
#

that u can keep on jumping without cooldown

mortal bridge
#

try resetting movedirection

quick pollen
#

but ofc add a stamina requirement and when ur stamina hits 0 u cant jump anymore

earnest atlas
quick pollen
#

but it still looks really weird

mortal bridge
#

you sure you put them in right places? show me the code @dense cypress

quick pollen
earnest atlas
#

same jump into bool variable

quick pollen
earnest atlas
#

on running jump code set another variable of "have jumped"

mortal bridge
#

yeaah I see

earnest atlas
#

and just run the jump code of
_isJumping&&!_hasJumped

quick pollen
#

like all of this could be fixed if unity had a function for resetting the value of an Axis

earnest atlas
#

nothing stops you from just editing it in runtime

verbal dome
quick pollen
quick pollen
earnest atlas
#

if I remember it should be Vector3

#

just set y to 0

quick pollen
#

and its not a vector3 its a float between -1 and 1

verbal dome
earnest atlas
#

you dont need to edit the INPUT

#

you can save the input

#

and edit it

quick pollen
quick pollen
#

but like

verbal dome
#

I don't see why you want 'sensitivity' here

quick pollen
verbal dome
#

Like a delay before you jump?

quick pollen
#

yeah

#

so u dont just immediately jump

mortal bridge
#

for update you go brr:
if (!IsOwner) return;
moveDir = Vector3.zero;
if (Input.GetKey(KeyCode.W)) moveDir = transform.forward+transform.forward;
if (Input.GetKey(KeyCode.S)) moveDir = transform.forward-transform.forward;
if (Input.GetKey(KeyCode.A)) moveDir = transform.right-transform.right;
if (Input.GetKey(KeyCode.D)) moveDir = transform.right+transform.right
moveDir.Normalize();

for fixxxxed update you go:
if (!IsOwner || moveDir.magnitude = 0)
{
m_Rigidbody.velocity = Vector3.zero;
return;
}
m_Rigidbody.AddForce(moveDir * moveSpeed * 25f, ForceMode.Force);

quick pollen
#

i dont want to have 3 different timers

eternal falconBOT
quick pollen
#

just for a single jump

mortal bridge
#

oh In fixxxed update it should be ==

#

I missed it

#

*if (!IsOwner || moveDir.magnitude ==0)

verbal dome
mortal bridge
#

@dense cypress

quick pollen
dense cypress
#

yep putting it in now

quick pollen
#

cuz most of it wont work using that

mortal bridge
#

dont forget double equal

dense cypress
#

yep

mortal bridge
#

work?

merry shuttle
#

How would I make it so the distance between the mouse and the player doesn't affect the projectile's speed? I've been trying to figure it out but can't. In the clip you can see that the bullet is a lot faster when your mouse is far away while you shoot and really slow when it's close
https://gyazo.com/9a5a15373234c6f4f58aed3925c7d2ee

private void shootBullet()
{
    if (onShootCooldown) return;
    onShootCooldown = true;
    Invoke(nameof(removeShootCooldown), shootCooldown);

    var currentPlayerPos = gameObject.transform.position;
    var newBullet = Instantiate(bulletPrefab, currentPlayerPos - Vector3.back, new Quaternion(0, 0, 0, 0), null);
    var bulletRigidBody = newBullet.GetComponent<Rigidbody2D>();

    var mousePosition = Input.mousePosition;
    mousePosition = mainCamera.ScreenToWorldPoint(mousePosition);

    var bulletDirection = mousePosition - currentPlayerPos;
    bulletDirection.Normalize();
    bulletRigidBody.AddForce(bulletDirection * 20, ForceMode2D.Impulse);
}
dense cypress
summer stump
mortal bridge
#

just remove the moveX and moveZ and directly update the moveDir based on the key pressed and add a line to normalize moveDir after every inputs done

#

that should do it

dense cypress
vague dirge
#

Hello, I have a question, what does transform.eulerAngle.y exactly do ? Like I know we get a rotation from the Y axis, but starting from where ? Because if we want a rotation, we need and axis (Y) an "end position", but also a "strat position" (= 0°), and what is it in this method ? Because I want to generalize it from an given vector axis and I'm planning to do that through Vector.SignedAngle(), but I dont know what to put in the from and to parameters. Thanks !

polar acorn
mortal bridge
polar acorn
#

Euler Angles are Vector3s that represent a Quaternion in the form of degrees about each axis

swift crag
#

Euler angles represent a rotation as three angles around three axes.

mortal bridge
#

@dense cypressyou want resources?

timber tide
dense cypress
swift crag
#

this gif will probably get obliterated by dyno, but let's try

#

sweet

#

oh you know what

#

this actually makes a lot more sense to me now

timber tide
#

friendship ended with euler, quaternions my new bff

quick pollen
mortal bridge
swift crag
#

no, it's just a demonstration of euler angles

dense cypress
swift crag
verbal dome
#

It's good to know the order that euler rotations are applied in

mortal bridge
verbal dome
#

Z, X, Y right?

timber tide
#

oh, there's an order?

dense cypress
mortal bridge
#

very good. glad to be helpful

timber tide
#

Why doesn't the method work like angleaxis then. Would probably solve some gimbal issues.

verbal dome
timber tide
#

that's such an odd ordering

verbal dome
#

It sounds odd at first, but it kinda makes sense to me

#

I can't explain why though 😄

#

I'm just used to Y being the 'parent axis'

#

And X is the child of that, and Z is the child of X

gray pond
#

when i click on a letter, it highlights white and then when i try to type to put a bracket or something between it deletes whatever's highlighted

#

what do

timber tide
#

I just know that in fps games you're usually rotating z -> y -> x (xyz) ordering

verbal dome
mortal bridge
verbal dome
#

Above the delete button

gray pond
#

thank u

#

idk when i even pressed that 😭

broken trellis
gray pond
#

silly little things

polar acorn
broken trellis
#

That's what got me rn

polar acorn
broken trellis
polar acorn
broken trellis
earnest atlas
#

did u save it?

broken trellis
# polar acorn in unity

error CS2012: Cannot open 'D:-Unity Projects\True TCG\True TCG\Library\Bee\artifacts\1900b0aE.dag\Assembly-CSharp.dll' for writing -- 'The requested operation cannot be performed on a file with a user-mapped section open. : 'D:-Unity Projects\True TCG\True TCG\Library\Bee\artifacts\1900b0aE.dag\Assembly-CSharp.dll''

#

Oh wait lel

#

I forgor to close vs code

earnest atlas
#

Im pretty sure vs code shouldnt stop you from loading in the file

broken trellis
#

And... closing it did nothing

swift crag
#

this wouldn't be your code editor's fault

broken trellis
#

Ugh, I hate compiler errors. They kill new coders

quick pollen
#

yeah this doesnt work at all

        if (jumpCooldown > 0f) jumpCooldown -= Time.deltaTime;
        if (Input.GetKey(KeyCode.Space) && windup <= 0f) windup = _windup;
        if (windup > 0f && jumpCooldown <= 0f) windup -= Time.deltaTime;
        if (windup <= 0f && Input.GetAxis("Jump") >= 1 && jumpTime > 0f)
        {
            jumpCooldown = _jumpCooldown;
            isJumping = true;
            gravPull.y = Mathf.Sqrt(_jumpHeight * _gravity * -10f);
            jumpTime -= Time.deltaTime;
        }
polar acorn
swift crag
#

this kind of thing makes me think you have two editors open