#💻┃code-beginner

1 messages · Page 358 of 1

magic panther
#

or is this a custom function he made

keen dew
#

That's neither Unity nor C#

#

Looks like Löve

analog dove
#

Yup, dt = delta time. But this is off topic. Not unity

magic panther
#

didnt know

frank delta
#

hey hey I already sent something in code general for help, mind if I send it here too?

#

oh dammit im dumb

ruby python
#

!ide

eternal falconBOT
rich egret
verbal dome
viscid needle
#

hey guys I was trying to create a game in which my player is controlled by my mouse pointer and whenever I touch my enemy(who walks around randomly) I restart the level.... but the player can collect energy for taking the player to a mode in which it can destroy the enemy's.

but while I was trying to make the Energy spawn randomly once more after bieng collected once the script is giving me an error for the spawnPosition of the Energy..... Please Help.

#

Here is the code

#

please hellpp

languid spire
#

what error? The only error I see is a missing ) on your Start method, which your IDE is also telling you about

viscid needle
#

this is the error

languid spire
# viscid needle no

well that is easy to fix, move your initialization of spawnPos to the Start method

viscid needle
#

no then it gets bombarded with errors

#

here I will show you

languid spire
# viscid needle

yes, because you are doing it wrong. I said move the initialization not the declaration

viscid needle
#

huh?

#

what do you mean?

languid spire
#

exactly what I said

viscid needle
languid spire
#

post you code correctly and I will show you

viscid needle
#

how

languid spire
#

!code

eternal falconBOT
viscid needle
#

here

languid spire
#

Ok.

public Vector3 spawnPos = new Vector3(Random.Range(-9, -4), Random.Range(9, 4), 0);

Declaration

public Vector3 spawnPos;

Initialization

spawnPos = new Vector3(Random.Range(-9, -4), Random.Range(9, 4), 0);
viscid needle
#

oh

#

so you telling me the initialization to the start

languid spire
#

yes

viscid needle
#

Thankyou

#

the issue got solved

languid spire
#

this is basic C# knowledge, you should know this

viscid needle
#

where did you learn all of it

languid spire
#

by reading the documentation

viscid needle
#

of unity?

languid spire
#

no, C#

viscid needle
#

ok thanks

#

you are a life saver

wary sonnet
#

can anyone help me in this please, I have setup all the things correctly but the play games auto sign in isn't working, it doesn't even print "sing in failed" in the build but it prints it in editor

using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
using UnityEngine.UI;

public class PlaySignIn : MonoBehaviour
{
    [SerializeField] private Text gmailText;
    void Start()
    {
        PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
    }

    internal void ProcessAuthentication(SignInStatus status)
    {
        if (status == SignInStatus.Success)
        {
            gmailText.text = PlayGamesPlatform.Instance.GetUserId();
        } 
        else 
        {
            gmailText.text = "Sign-in Failed";
        }
    }
}
#

I have correctly setup the package resources ids all correctly, as I was following a tut, I copied all the step as it is, still doesn't work for no reason

languid spire
#

is ProcessAuthentication even being called?

wary sonnet
viscid needle
#

hey @languid spire my code does not show any errors but the new game object does not spawn

#

can you help plese

languid spire
#

but you said it's not doing that in a build so my question still stands

wary sonnet
#

could there be any problem while building game ?

languid spire
#

ofc

wary sonnet
#

but why that happen on building ? like scripts don't change behaviours on building

languid spire
wary sonnet
#

ah

#

lemme check it

languid spire
sleek notch
#

Can someone explain me why it is not spawning?

viscid needle
wary sonnet
#

myabe I should put it on the bottom, so it gets the time it want ?

languid spire
viscid needle
languid spire
#

well you have to call spawnObject from somewhere otherwise it will not run

viscid needle
#

oh ok I understood

languid spire
eternal falconBOT
#

:teacher: Unity Learn ↗

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

wary sonnet
#

my dependency folder only have a "editor" folder no "android" folder

#

it must have that

#

is there any way I can manually do corrects for it ?

#

like adding it externally ?

wary sonnet
sleek notch
#

I'm spawning ui element

#

Is it problem?

wary sonnet
#

but I am talking about the dependency manager

languid spire
wary sonnet
#

I will obviously

#

but I am asking bout the folder "android" where we can find some kind of file( I don't remember correctly) but with that we get a option to enable auto resolver

wary sonnet
wary sonnet
# wary sonnet

Everytime I check the android and hit apply it load the domain and once compilation is completed, it instantly reloads again and uncheck that ;-; ?

#

sry for the ping

tranquil hollow
#
{
    [SerializeField] private float speed = 5f;
    private Rigidbody2D rigidbody2D;

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

    void FixedUpdate()
    {
        float moveInput = Input.GetAxisRaw("Horizontal");

        rigidbody2D.velocity = new Vector2(moveInput * speed, rigidbody2D.velocity.y);
    }
}
#

why my player dosent walk horizontal?

slender nymph
#

any errors in the console? do you have any constraints on the rigidbody?

languid spire
wary sonnet
burnt vapor
slender nymph
languid spire
wary sonnet
#

oh ok

languid spire
# wary sonnet oh ok

If you are only building for Android and running in Editor, set it to Any Platform

wary sonnet
#

it still reverts it

#

unity is high xD

polar token
#

the mouvement feels bad the physics material is 0.6 bouciness and 1 friction this is the code any fix i can add

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

public class PlayerMouvement : MonoBehaviour
{
    private float horizontal;
    private float speed = 5f;
    private float jumpingPower = 12.5f;
    private bool grounded;

    [SerializeField] private Rigidbody2D rb;
    [SerializeField] private LayerMask groundLayer;

    void Start()
    {
        print("hello unity");
    }

    // Update is called once per frame
    void Update()
    {
        horizontal = Input.GetAxisRaw("Horizontal");

        if (Input.GetButtonDown("Jump") && grounded)
        {
            rb.velocity = new Vector2(rb.velocity.x, jumpingPower);
        }

        if (Input.GetButtonUp("Jump") && rb.velocity.y > 0f)
        {
            rb.velocity = new Vector2(rb.velocity.x, rb.velocity.y * 0.5f);
        }
    }

    private void FixedUpdate()
    {
        grounded = Physics2D.CircleCast(rb.position, 0.4f, Vector2.down, 0.05f, groundLayer);

        rb.velocity = new Vector2(horizontal * speed, rb.velocity.y);
    }
}

hollow dawn
#

How do I make my players head and arm follow where I look? if I make them a child of the camera my arms glitch out.

polar token
solid mango
#

That's because you have friction to 1

polar token
solid mango
#

Try different values but start from 0

verbal dome
#

I think high friction is fine for a rolling ball. Otherwise it would slip

polar token
#

if i do 0 the ball will not roll

verbal dome
#

Your problem is that you are directly changing rb.velocity

#

AddForce would probably work better for what you want

polar token
#

hmm i will try

chrome tide
#

3D Random Map Generation Problem

wide wing
#

hi guys

sleek notch
#

I have a question. How to capture if player will input other key than I want? I mean: Player must type: T but he types E and I need to capture if player input is not null

sleek notch
#

Okay thanks

polar token
#

it's probably a stupid question why is it not jumping

if (Input.GetButtonDown("Jump") && grounded)
        {
            rb.AddForce(new Vector2(rb.velocity.x, jumpingPower));
        }

        if (Input.GetButtonUp("Jump") && rb.velocity.y > 0f)
        {
            rb.AddForce(new Vector2(rb.velocity.x, rb.velocity.y * 0.5f));
        }
languid spire
#

at a guess grounded is false or jumpingPower is zero

slender nymph
#

when using AddForce for jumping you want to also use ForceMode2D.Impulse

polar token
#

ok

west gulch
#

Hello everyone! I want to make dialogues in my game appear like this ⬇️
But I don't know how to name this method of dialogue display and therefore I can't find anything related to it... Any links to tutorials or advice on how to implement it will be appreciated!

languid spire
#

Speech Balloons?

slender nymph
west gulch
# languid spire Speech Balloons?

Yeah, speech bubbles or something like that will do, thanks! Do you know by any chance how I can make them always look towards the camera in a 3D game?

polar token
languid spire
lament sable
#

is there a reason why my mesh renderer isn't following my prefab

wintry quarry
lament sable
burnt vapor
lament sable
slender nymph
#

!code

eternal falconBOT
slender nymph
#

but also that component is attached to the child object not the root so if does any movement, then it moves the child not the root object

teal viper
# lament sable

What is the issue though? That screenshot doesn't explain anything.

slender nymph
#

the link you posted then deleted was the correct way to share code

#

oh my god dude, just paste the link and leave it

lament sable
slender nymph
#

yes. now go back and read my earlier message about what is causing your issue

#

also don't multiply mouse input by deltaTime. mouse input is already framerate independent so multiplying it by deltaTime is just going to force you to make your sensitivity variable about 100 times larger than it needs to be, it will also cause camera controls to be stuttery and framerate dependent again

lament sable
#

it doesn't work

slender nymph
#

be more specific

lament sable
#

fox itself is moving independent from the prefab and the transform vectors

slender nymph
#

is the component still attached to the child object and not the prefab root?

willow breach
#

Hey, I have a weird issue, i defined a class and when i access it i have two instances duplicated for some reason

public static class Maps {
    public static Map mapA = new Map("map a", 1, new ElementalEncounter[] {
        new ElementalEncounter(Elementals.elementalA, 0.3f),
        new ElementalEncounter(Elementals.elementalB, 0.7f),
    });

    public static Map[] versionAMaps = { mapA };
}
  "mapName": "map a",
  "elementalEncounters": [
    {
      "elemental": {
        "idNum": 1,
        "name": "a",
        "type": 0,
        "catchRate": 1.0
      },
      "encounterChance": 0.30000001192092896
    },
    {
      "elemental": {
        "idNum": 2,
        "name": "b",
        "type": 1,
        "catchRate": 0.5
      },
      "encounterChance": 0.699999988079071
    }
  ],
  "requiredLevel": 1
}```

but when i load it i get 
```private Map currentMap = Maps.mapA;

currentMap = {
  "mapName": "map a",
  "elementalEncounters": [
    {
      "elemental": {
        "idNum": 1,
        "name": "a",
        "type": 0,
        "catchRate": 1.0
      },
      "encounterChance": 0.30000001192092896
    },
    {
      "elemental": {
        "idNum": 1,
        "name": "a",
        "type": 1,
        "catchRate": 1.0
      },
      "encounterChance": 0.699999988079071
    }
  ],
  "requiredLevel": 1
}```
slender nymph
#

so then based on what i've told you and the fact that you are still experiencing this issue, what do you think you need to do?

lament sable
#

quiting

slender nymph
#

show how you've set this up

neat bay
#

does anybody have a good tutorial on how to import model s from blender to unity?

#

ive tried alot of them and i just dcant get it to work for me

lament sable
slender nymph
neat bay
#

ok thanks

slender nymph
# lament sable

well i can clearly see that the component is still attached to this object when it should be attached to the root of the prefab. of course i didn't just want to see the mesh renderer, i don't know what gave you the idea that was all i needed to see

neat bay
#

I'm assuming "FBX Exporter" is what I'm looking for right?

slender nymph
#

why don't you ask for help in that channel if you cannot figure it out from the documentation because this is a code channel where as your question belongs in the channel i linked you to

neat bay
#

ok sorry

slender nymph
wide wing
#

no one seems to help me here why is this erver created for

slender nymph
teal viper
languid spire
wide wing
lament sable
slender nymph
lament sable
slender nymph
wide wing
lament sable
slender nymph
teal viper
languid spire
lament sable
teal viper
willow breach
#

is there a reason why the ElementalEncounter are both Elementals.elementalA (even though the second is B) when i access Maps.mapA?

public static class Maps {
    public static Map mapA = new Map("map a", 1, new ElementalEncounter[] {
        new ElementalEncounter(Elementals.elementalA, 0.3f),
        new ElementalEncounter(Elementals.elementalB, 0.7f),
    });

    public static Map[] versionAMaps = { mapA };
}
slender nymph
# lament sable

remove the Fox component from FoxTransform. then consider looking into how to move using the rigidbody instead of the transform

lament sable
slender nymph
#

literally the "root" of your prefab (or what was, but now is not, a prefab)

wide wing
teal viper
wide wing
#

i am being polite to everyone here

teal viper
wide wing
#

waht are u doing on sunday here then

wide wing
languid spire
barren vapor
willow breach
willow breach
wide wing
#

im using a runner template of unity and im a beginner

teal viper
willow breach
wide wing
willow breach
barren vapor
wide wing
summer stump
barren vapor
willow breach
# teal viper Where?

i dont understand your question, i debugged the code in vscode, i put a break point and saw the values on run time

wide wing
#

AND HE SAID RUDELY " DOES IT NOT ENTER YOUR HEAD"

teal viper
barren vapor
summer stump
teal viper
summer stump
#

Are you calling setactive from the object that is not active?

teal viper
summer stump
wide wing
burnt vapor
# wide wing

Please stop spamming the chat and either discuss your actual issue or don't post at all

swift crag
# wide wing

if you're going to act like a child, you're going to be treated like one.

#

cease.

wide wing
swift crag
#

i can gladly try to help you with your problem

wide wing
#

thats what u are saying

swift crag
#

but i cannot help you with whatever this is

summer stump
#

Literally asked a question to help you and you ignore it to keep spamming

Are you calling setactive from the object that is not active?

swift crag
#

also, i can assure you that steve's response was not particularly rude.

willow breach
swift crag
#

this isn't a "you just wait until you see what REAL rudeness is" threat; it's just...an observation

burnt vapor
#

I think enough has been said, let's continue on the actual topic of this channel

teal viper
willow breach
teal viper
willow breach
#

yes

#

no one changed the value of currentMap and no one changed the value of Maps.mapA

teal viper
# willow breach yes

Okay. One possibility is that mapA is modified after the first breakpoint and before the second one.

raven kelp
#

what can I use component for in scripting? I tried [SerializeField] component m but I cant do anything with the m variable

wide wing
fickle plume
#

!mute 718044028754460723 1d Cool off and try again tomorrow

eternal falconBOT
#

dynoSuccess aly0794 was muted.

burnt vapor
#

Ugh

willow breach
swift crag
#
`Send inline code like this`
raven kelp
#

thank you i forgot

swift crag
#

A field of type Component can store any component

raven kelp
#

also wtf thats the blockout command

#

very sorry

swift crag
#

This is probably not very useful.

raven kelp
#

yes

swift crag
#

since you can only use it for things that every component can do

fickle plume
#

@wide wing Meanwhile you can check those UI tutorials I've pointed you to in the first place. Your question was about you being unable to figure out how UI asset works with scripting.

molten dock
#

@raven kelp

raven kelp
#

how do I get a specific component out of it? Im trying to get an interface directly but since public interfaces dont show up in the editor I tried a generic component and it failed because uh idk

molten dock
#

dumb

swift crag
#

The first option is to just cast it.

raven kelp
#

oh

swift crag
#
ISomething something = theField as ISomething;
#

alternatively

willow breach
# teal viper How do you know that?

the only place that use it is
private Map currentMap = Maps.mapA;
and the only use is
Elemental e = currentMap.GetEncounter();

and this is the function:

  public Elemental GetEncounter()
    {
        List<Elemental> encounterPool = elementalEncounters
            .SelectMany(e => Enumerable.Repeat(e.elemental, (int)(e.encounterChance * 100)))
            .ToList();
        int randomIndex = UnityEngine.Random.Range(0, encounterPool.Count);
        return encounterPool[randomIndex];
    }
swift crag
#
ISomething something = (ISomething) theField;
raven kelp
#

(InterfaceName)m?

swift crag
#

I think that throws an exception if it fails

#

If you're going to use interfaces heavily, I'd suggest checking this out:

teal viper
# willow breach because nothing access it

I see that it's referenced in the versionAMaps array. It could be mofified via that reference.
I'd suggest making the fields private and exposing them via a methods or properties. Then you can debug whenever they're changed or accessed.

#

Don't use public fields.

swift crag
willow breach
raven kelp
swift crag
#

very useful for figuring out who the heck is modifying a field

swift crag
#

You can also just download it directly as a .unitypackage

barren vapor
teal viper
swift crag
#

great names, yeah 😕

neat bay
teal viper
#

But yeah, you can see references.

teal viper
swift crag
swift crag
#

I use OpenUPM for quite a few packages. There is a small CLI program for adding the packages to your project's manifest file.

#

(it just puts the package into a list for you, basically)

raven kelp
# swift crag You can also just download it directly as a .unitypackage

Is making everything serializable a good idea when making a game? At the moment I'm making an interface for a physics controller, so I can quickly swap out the controller scripts if I need to move an object differently. The main controller needs the interface reference so it can use any script

west gulch
#

If I’m going to use new input system, will my character be able to rotate using keyboard input as well?

teal viper
# willow breach still happen

Another possible cause, though a bit skeptical, is that you're assigning it in the field initializer and the static field is also initialized in the initializer. Honestly, this whole setup is a bit fishy.

willow breach
west gulch
swift crag
willow breach
teal viper
# willow breach haha maybe, im new to c# btw i added readonly to the mapA and it still happened...

Here's one advice: don't make things complicated. Only use code that you're 100% sure about. I have more than 5 years of experience with C#, but I'd never use a setup like you have, because I'm not sure in what order the things are initialized. Sure, logically thinking the static field should be initialized when it's accessed and if it wasn't it would just be null, but with unity serialization added to the mix, you never know.

teal viper
# willow breach is it ok if ill stream it for you for a sec?

Nah, sorry.
Here's what you should do to fix/debug the issue: make all the fields private(not readonly). Initialize them in constructors or Monobehaviour init methods, like Awake. Print everywhere you access or modify something to see the order of execution in the console.

willow breach
teal viper
#

hardcoding your data is a terrible idea in most cases.

willow breach
#

and if possible, i dont wont just to fix it, i want to understand what happened there

raven kelp
willow breach
#

nothing is accessing this field and manipulating it, i even set it to readonly and this issue still happens

teal viper
swift crag
#

the "as" syntax silently produces a null if it doesn't work

burnt vapor
#

The best way of checking a type is with pattern matching

raven kelp
burnt vapor
#
if (a is ISomething)
{
  var something = (ISomething)a;
}
swift crag
#

even better

#
if (a is ISomething something) {
  ...
}
burnt vapor
#

If that works in Unity, sure

#

But it is so massively behind that it probably doesn't

swift crag
#

I use it all the time

#

so I hope it works!

burnt vapor
#

Then it's caught up finally

swift crag
#

I can't figure out when is was introduced (when looking at its doc page), so it has to be pretty old

burnt vapor
#

I meant the direct assignment in the statement itself

#

That one is fairly new

swift crag
#

oh yeah, that's relatively new (and supported, yeah)

willow breach
swift crag
#

similar to

if (dict.TryGetValue(key, out var thingy))
willow breach
slender nymph
rich adder
teal viper
raven kelp
#

I think I need to stop coding at 1am, my life would be much easier

burnt vapor
#

Though this isn't directly a type or method so maybe it doesn't

raven kelp
#

I dont think a is ISomething. I don't know what I screwed up. Firstly, the interface is in the same gameObject as the controller script, so I dragged the interface directly into the serialized component. The interface I am referencing is also a monobehaviour. I tried

rich adder
swift crag
#

oh, the component with the interface

burnt vapor
swift crag
#

You are probably just referencing the wrong thing.

rich adder
raven kelp
#

A in New Controller is my component variable. Weird Move is part of the interface class and also apart of the monobehaviour class

swift crag
#

show me the definition for WeirdMove

raven kelp
#

Like just this?

rich adder
#

that font lol

swift crag
#

looks like a Japanese/Chinese/etc. font

swift crag
raven kelp
rich adder
#

can interface even be a component ?

swift crag
#

no, but the reverse is possible

#

well

raven kelp
#

get a component out of an interface?

swift crag
#

no, both ways are possible!

rich adder
#

oh wow didn't know that. TIL

#

always did TryGetComponent

swift crag
#

If you have an interface-typed variable, it can refer to anything implementing the interface

#

which could include a component

swift crag
#

i'd like to see what you actually have here

raven kelp
#

ah i shouldve done that at the start

#

Thats what gettype does

#

its weirdMove wtf

#

its bruh

swift crag
#

and the console logs "No worky" ?

raven kelp
#

I replaced No worky with gettype

#

so yes it is in spirit, "No worky"

#

so weirdMove is not newMove.

#

wait

#

what just happened

#

my gettype print command is unreachable

swift crag
#

show me your current code.

raven kelp
swift crag
#

you have two components in the scene

#

one has a reference and one doesn't

raven kelp
#

1am coding adventures strike again

#

thank you

#

I am so sorry

willow scroll
raven kelp
#

I dont get this, fen said this too

#

j is nothing

#

its private now

sleek notch
#

Hi I need help. I'm doing game where you have to type words by input but for no reason it stops working and game probably crashes and stop cathing input from a player

willow scroll
swift crag
willow scroll
swift crag
#

it creates a new local variable

#
if (a is newMove j) {
  this.j = j;
}

you'd have to do this to assign it into the field

willow scroll
#

That's because you're doing it wrong

sleek notch
#

no

swift crag
#

"probably crashes"?

#

a crash makes the game completely quit

#

perhaps you mean it's freezing?

#

where it locks up and Windows eventually says that it's not responding

orchid oyster
#

Unity is crashing during build for android gradle error what could go wrong tried googling tried few things but can't figure out

slender nymph
#

#📱┃mobile
also is it actually crashing as in completely closing unity, or is it just failing to build. because those are two completely different things

slender nymph
#

then you should say that instead of saying that it crashes. because, again, those are two completely different things and being as specific as possible when trying to get help is important to get the correct help. anyway, your question is not code related so delete it and repost in #📱┃mobile and provide as much detail as possible, including the details of the actual error

willow breach
#

If I have a lot of data for the game (many monster stats, maps, items etc) where do I store it? Should I just dump it to a json or maybe sqlite file?
What is the common practice?

swift crag
#

JSON is convenient for editing outside of Unity. The main problem is referencing that data.

#

you can use integer IDs, as long as you keep them consistent

willow breach
#

For example I want to load a map and assign what monster will spawn there

shy ruin
#

I don't know is this goes in coding help, but I have 2 objects. I am setting the rotations of them to each other, but they have different base rotations. The 1st object at 0,0,0 rotation points left, the other objects points right at 0,0,0. How am I supposed to set the rotation of them to each other if they point different locations when they are exactly the same?

rich egret
#
    {
        Debug.Log($"Room count: {roomItemsList.Count}");
        Debug.Log("OnRoomListUpdate called.");

        if (Time.time < nextUpdateTime)
        {
            return; // Skip updates if not yet time
        }
        nextUpdateTime = Time.time + timeBetweenUpdates;

        UpdateRoomList(roomList);
    }

    void UpdateRoomList(List<RoomInfo> roomList)
    {
        for (int i = roomItemsList.Count - 1; i >= 0; i--)
        {
            RoomItem item = roomItemsList[i];
            if (!roomList.Exists(room => room.Name == item.roomNameText.text))
            {
                roomItemsList.RemoveAt(i);
                Destroy(item.gameObject);
            }
        }

        // Add new room items
        foreach (RoomInfo room in roomList)
        {
            if (!roomItemsList.Exists(item => item.roomNameText.text == room.Name))
            {
                RoomItem newRoom = Instantiate(roomItemPrefab, _content);
                newRoom.SetRoomName(room.Name);
                roomItemsList.Add(newRoom);
            }
        }
    }```

pls i need help, the function `OnRoomListUpdate` is not called 🥲
willow breach
cunning narwhal
rich egret
#

ok thanks

swift crag
#

the other option is to use ScriptableObjects

#

you can create new kinds of assets and reference them directly

willow breach
cunning narwhal
#

No problem. It's just that without some kind of way for your application to use that, it wont just pick it it up automatically, so you gotta have some other class or event or something say hey I want to explicitly call this and then it will do so based on whatever meets the criteria for the caller to use it

swift crag
#

you can't possibly reference things from a static class in the inspector

slender nymph
willow breach
#

oh you talk about the inspector, is it that important? i rather control it from the code anyway

rich egret
slender nymph
analog pivot
#

forgive my confusion with coding. how does the code know how to effect the correct items and assets in the project? Maybe Im trying to start too big.

Im trying to make the buttons in the yellow tab disable in the next section then the one next to it. Maybe Im starting too big?

eager wolf
#

how should I go about making it so that if any of the variables in {} are null, it doesn't skip a line? (without using a huge list of "if" conditions)

swift crag
analog pivot
#

Ive been trying to find tutorials on how to set code but it doesnt seem to match my requirements right

swift crag
#

It can combine a bunch of objects together.

willow breach
swift crag
#

You might do this...

eager wolf
#

for context, i want to avoid the "range:" line from appearing if range is null

swift crag
#

oh wait, it won't be quite that easy

#

since each line has its own prefix it wants to display

#

I was going to suggest this

cunning narwhal
swift crag
#
List<string> entries = new();
entries.Add(itemData.AttackDamage);
entries.Add(itemData.AttackRange);
entries.Add(itemData.AttackSpeed);
string.Join("\n", entries.Where(entry => entry != "");
#

something like this

#

(you'd have to call ToString on those items, too, and that requires a null check for each...

eager wolf
#

you the man, let me try that

swift crag
#

It's not appropriate here though

#

it doesn't show "Range: ", etc.

eager wolf
#

oh, ok, you got a better idea?

slender nymph
swift crag
#

if they're getting ToString()'d then the empty comparison makes sense

#

but I suppose the IsNullOrWhitespace is still a better choice, since it also filters out anything that looks blank

eager wolf
#

So what would that look like?

swift crag
#

i don't have a better suggestion right now

#

If you need to conditionally exclude entire lines, and the lines aren't empty when they should be excluded, then I'd just do an if statement for each one

split dragon
#

Hi. I have a question: Which option is better? Through a loop in void Update, assign bool bools using Toggle or create a separate method for each Bools?

wintry quarry
#
public void Set(int i, bool val) {
  Bools[i] = val;
}```
Just one method like this^
eager wolf
#

just letting you know, if ever it helps you in the future

wintry quarry
#

A StringBuilder would be a bit more efficient, but that works

gaunt ice
#

itemData.attcakRange sounds likes a float or int or long and never been null

analog pivot
#

I got this code from ChatGPT Im guessing I need to rename the code lines to match the name of the buttons?

slender nymph
wintry quarry
analog pivot
#

apologies

#

i will figure how to make code not useless

swift crag
#

I would suggest making it so that each object can display itself

#

so that itemData.AttackDamage.ToString() spits out "Damage: 123"

analog pivot
#

so is AI worthless to help learn code with

#

sorry if these questions come across as "dont asks"

summer stump
cunning narwhal
#

probably not entirely worthless but more of a guide if you know what youre doing already and need another perspective to then evaluate if its useless

#

Because otherwise you end up with stuff you copy over and use but have no idea how it truly works, which is then not going to help you whatsoever to try and fix/debug

analog pivot
#

!learn

swift crag
#

yes, it is actively harmful

summer stump
eternal falconBOT
#

:teacher: Unity Learn ↗

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

rich adder
#

gpt is like a non-cute secretary

summer stump
#

Don't look for tutorials that exactly fit your specific issue. Learn the basics and use tutorials for inspiration

cunning narwhal
zenith cypress
#

It's useful if you already have a somewhat good understanding of what you are needing information about. It's not good for "just give me code" but it can be useful for partial code explanations, or finding an obscure api that may or may not exist (but if it does exist then it solves whatever problem it was), or possible avenues for finding new coding patterns you didn't know before. It's basically a drunk rubber duck, so you can't always rely on its output LUL Phind is cool since it gives you links to actual sources + follow up questions.

summer stump
#

I would agree with all that. And yeah, phind is the best one of all the gpt wrappers imo

rich adder
#

it can at times offer better result than google in certain aspect, google after all makes money on showing you biased results
not to say
its not dangerous in the hands of newbies who think its a code generator rather than a searching tool

analog pivot
#

thanks. been hard to understand.

hardy mist
#

Does Unity pack image files into atlases automatically?

swift crag
#

No, you have to turn on sprite atlasing

hardy mist
spiral narwhal
#

_affectedEntityRigidbody.AddForce(Vector2.left * _knockBackForce);

Is this the intended way or do I need to normalise something? Because this requires a huge force float to have a visible effect

swift crag
#

AddForce applies a constant force by default.

#

If you give it Vector3.left every FixedUpdate, it pushes with 1 newton of force

spiral narwhal
#

Isn't that what I want for a knockback?

#

A constant force I mean

swift crag
#

this accelerates a 1kg object by 1 m/s every second

#

knockback is generally an instant thing

slender nymph
swift crag
#

check out the different force modes

spiral narwhal
#

Will do! Thanks

slender nymph
#

handy image that explains the different force modes

swift crag
#

One second of AddForce with ForceMode.Force is equivalent to calling it once with ForceMode.Impulse

spiral narwhal
#

Hm with Impulse I don't seem to get any movement whatsoever...

       
        public void ApplyKnockBack()
        {
            _affectedEntityRigidbody.AddForce(Vector2.left * _knockBackForce, ForceMode2D.Impulse);
        }

The rigidbody mass is 1

slender nymph
#

are you perhaps overriding velocity somewhere else?

#

or is _knockBackForce incredibly small

spiral narwhal
#

Ah yes the movement script uses the rigidbody too

#

So I must use the other mode then?

summer stump
#

You need to stop setting velocity while you do the knockback

spiral narwhal
#

Can I add a second rigidbody as an easier solution

rich adder
#

no

#

make simple bool.. if(knockingBack) don't apply the movement velocity. or better use simple State Machine with enum

swift crag
#

that wouldn't make any sense

#

you'd have two velocities and positions for the same object

swift crag
spiral narwhal
#

I see

warm condor
#

Hi guys, I was wonderring you can help me answer what the time variable is in the function AnimationCurve.Evaluate(time). I looked it up in the unity documents but I still do not understand what it does.

rich adder
#

imagine its a timeline and you want to know where is the value at x time

#

if you pass In 1 , you get 1

warm condor
#

ohhh ok I see. I think I understand it better. I was using the function with the time as a constant variable like 3 and so there was no increase in the value.

swift crag
#

the time is often in the [0..1] range

#

but you can make a curve that covers any time range

#

It's much like how Lerp's third parameter is "t"

rich adder
spiral narwhal
#

Got the force to work but this caused a new issue where the friction material causes the knockback force to never stop. Any ideas what I can do?

spiral narwhal
#

To avoid sticking to platforms

rich adder
#

thats easily to fix another way, imo this is the worst ways

#

you would cast in movement direction, and if is blocked then just dont apply movement in that dir

#

or you could at very least put Nofriction material while in air, I still think that material method is just brute forcing one problem to create others

spiral narwhal
#

I see

#

Thank you

warm condor
rich adder
#

you could clamp i guess

warm condor
rich adder
#

you keep adding velocity instead of setting it

swift crag
#

The animation curve does nothing but tell you your acceleration here

#

If you want a max velocity, then clamp the velocity

#

you won't change how you use the curve

warm condor
slender nymph
#

Mathf.Clamp

swift crag
#

there's also Vector2.Clamp or Vector3.Clamp if you want to clamp the entire vector

#

but you're strictly looking at the X velocity here

#

so Mathf.Clamp is what you want!

warm condor
gentle stratus
#

https://hastebin.skyra.pw/yetaciveco.csharp have this code to change an enemy's material from all black to its regular one if it enters a player's view collider, but when i bump directly into the enemy and then walk backwards it assumes it exited even though the enemy is still in the collider, how can i fix this

slender nymph
#

presumably some trigger collider did stop overlapping

warm condor
#

so for example the time is on the Y axis

sterile plover
#

how can i change and customize the input of cinemachine like i would like the camera on the Y axis to move everytime along the mouse delta but the X axis to move with the mouse scroll kinda like a zoom

slender nymph
#

did you look at the settings on your vcam?

cunning narwhal
#

the render graph compatibility mode should be disabled here right? This is just enabled for current projects using it before they fully migrate to 6?

rich adder
ashen niche
#

help with enemy ai code?

slender nymph
sterile plover
stuck palm
#

how can i fix this?

sterile plover
#

meaning i cant just make and input for X and an input for Y

slender nymph
void thicket
gentle stratus
stuck palm
sterile plover
slender nymph
gentle stratus
#

which object the player or enemy

sterile plover
#

i need to change the scrip^t that manage it ??

slender nymph
#

like open your input action asset and change it

sterile plover
#

but it dont work

slender nymph
#

why would it not work

sterile plover
#

like i can only assign 1 input for both X and Y

slender nymph
#

incorrect

sterile plover
#

i need separat input for X and Y

sterile plover
slender nymph
gentle stratus
#

specifically it says the character controller of the enemy (the cylinder outline) exited the trigger but like its not significantly bigger than the enemy itself so theres no way it couldve exited here

sterile plover
#

cinemachine input provider script say for the input assign it say XY axis so i tought with only one input it manage both X and Y axis

slender nymph
slender nymph
gentle stratus
sterile plover
slender nymph
#

this is why i told you to read the documentation for the input system.

#

you need a vector2 composite so you can select the individual inputs for each axis

sterile plover
#

this is vector 2

slender nymph
#

so we're just going to ignore the "read the documentation" bit then, eh?

sterile plover
slender nymph
#

and keep in mind that OnTriggerXXX messages are sent to the rigidbody parent as well as the object the collider is actually attached to

gentle stratus
#

this is the enemy prefab

rich adder
#

wow that collider..

gentle stratus
#

this is the player

rich adder
#

very bad

gentle stratus
#

whys that

rich adder
#

they are seperate controllers?

#

CC works with OnTrigger methods anyway, and you can use OnCharcterHit method if you need something close to OnCollision, so no reason at all to use Rb

#

if you want rigidbody don't use cc

gentle stratus
#

so is that why im getting the bug

slender nymph
rich adder
#

You can probably delete that diamond shaped collider too, that looks like an optimization nightmare

gentle stratus
slender nymph
#

the issue happens when you collide with the enemy then back off from it. OnTriggerExit is being called when the player's collider exits the enemy CC

#

you would be much better off using physics queries for this behavior instead of relying on OnTrigger messages tbh

gentle stratus
gentle stratus
slender nymph
#

overlapsphere

gentle stratus
#

ill look into that

ashen niche
#

enemy ai help

rich adder
gentle stratus
#

makes sense

rich adder
swift crag
#

ah, the Michelin Man

ashen niche
#

see thread

rocky canyon
rich adder
#

I need this

rocky canyon
#

thats alot eh..

#

it is a good model tho..

rich adder
#

We went too far with the downscaling last time 😦 We increased the poly count a bit so the model doesn't look horrible in game

#

lol

rocky canyon
#

just a little less 😄

rocky canyon
#

probably his protruding eyeballs

rich adder
stuck palm
#

@rich adder trying to wrangle this controller is intimidating

#

keep getting this error so i cant even start working on it lol

rich adder
#

maybe you didn't assign something? been a while since I've used it

slender nymph
#

i'd guess that the motor.CharacterController hasn't been assigned

stuck palm
slender nymph
#

called it

stuck palm
#

where do i assign it though

#

im using this package i found

#

or navarone graciously gifted me

slender nymph
#

i am aware of the KCC package and use it myself. did you not read the documentation that comes with it?

#

it should show you how to implement the ICharacterController interface and also assign it to the CharacterController property on the motor

stuck palm
slender nymph
#

yep, definitely give that documentation a good read. but all you really need to do to fix that issue is assign your motor's CharacterController property to this in Start on your ICharacterController component

stuck palm
slender nymph
#

yeah, you have to assign to it manually in code

void dawn
#

Where can I learn to code for unity

slender nymph
#

!learn

eternal falconBOT
#

:teacher: Unity Learn ↗

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

rich adder
rocky canyon
#

very fluid 👍

rich adder
rocky canyon
#

ohh shucks

rich adder
#

gta4 and others

rich adder
rocky canyon
#

whats this error hinting at?

#

i think its b/c of the SO property window

#

its intermitten

rich adder
#

probably didn't like the window got separated ?

#

Unity editor errors are weird

#

esp when you customize the layout too much

primal lintel
#

I don't know why my animations don't work..

rocky canyon
rich adder
#

yesterday in the inspector i had 4 nested classes and Unity editor took a shit spammed in errors on 2022

rocky canyon
#

also..not sure im doing this right.. but i don't have a mono for my settings.. i just assign them via the project window..

#

seems to have always worked.. but im going back and revisiting and refactoring..

#

just trying to make sure it is a valid approach.. and a non-reason the error could exist

rocky canyon
rocky canyon
#

works like crap.. so i finally just deleted the climbing mechanic 😄

#

i'll do something work-around-ish.. like disable controls and move the character to the top and hten re-enable

rich adder
#

I want to resolve 2 issues:
-my player should be able to climb ladder but be able to get off inside a space even if its crouch sized
-player should also be able to choose another ladder/climbable surface to grab onto

primal lintel
tame mist
#

not really a scripting issue but I'm just wondering why when i put a circle collider 2d on this sprite the collider is going from front to back around the sprite rather than around the sprite like it should

swift crag
#

the object is probably rotated

#

hit W to switch back to arrow gizmos

#

and make sure you're in pivot + local mode

rocky canyon
swift crag
#

ah, yeah

#

the player has been rotated

#

your blue axis (local +Z) matches the world +X axis (the red cone in the top right)

#

I don't think circle colliders respond to rotation at all

rocky canyon
#

well was like i said i deleted it.. wasn't happy with the unmount

tame mist
rocky canyon
#

one of Dapper-dino's old tutorials

swift crag
rich adder
tame mist
rocky canyon
rich adder
#

I learned the hardway through this water controller that multiple points are needed

swift crag
#

i need to go re-visit a parkour system

#

i got a pretty good feeling ledge-climb mechanic going

rich adder
#

for example when in water there is huge differences between being fully submerged and halfway or just feet

rocky canyon
#

yea, vaulting is what i want to do. at the very minimum..

rich adder
rocky canyon
#

soo when a ledge is just outside the jump height

#

wanna climb up on it

rich adder
#

their parkour controller is lowkey fire

#

looking at ledges to clumb is very intuitive

rocky canyon
#

can't beat TitanFall/Apex Legends 🤤

rich adder
#

its good for arcade climb wall or wallride, but not so much more complex buildings like towers

rocky canyon
#

apex legends was my controllers insipiration

rich adder
#

assasins creed nailed it, but in fpv is harder

#

Apex is source engine

#

thats why it feels nice

#

they have the best Surf-like controllers , Source SDK was my fav

rocky canyon
#

missing bunny hops

rich adder
#

haha top speed bunny hop 🐇

rocky canyon
#

ya, i havent even started thinkin about bunny hoppin

#

tho it would be awesome to add

rich adder
#

yeah source2 or at least cs2 pretty much killed bunny hops

rocky canyon
#

i think my controller is pretty solid on the movement..

#

with some camera headbob action and it will be awesome

rich adder
#

are you using rigidbody or cc ?

rocky canyon
#

CC 😩

rich adder
#

cc is good

rocky canyon
#

b/c i like to beat myself up

rich adder
#

it just takes a bit more patience 😅

queen adder
#

Trying to make an object stick to my player, but it's staying in place after it gets parented, not sure why.

rich adder
#

faking physics aint easy when you know minim

stuck palm
#

@slender nymph you said you've used the KCC, do you know how to like disable the motor? can i just set enabled = false or would that break things?

rich adder
#

probably maintaining the offset

random cave
#
void OnGui()
    {
        Debug.Log("Drawing GUI");
        if (!showConsole) { return; }
        float y = 0f;

        GUI.Box(new Rect(0, y, Screen.width, 30), "");
        GUI.backgroundColor = new Color(0, 0, 0, 0);
        input = GUI.TextField(new Rect(10f, y + 5f, Screen.width - 20f, 20f), input);
        Debug.Log("GUI Drawn");

    }```
Anybody know why my gui not drawing? if showconsole is true or false it doesnt debug anything
queen adder
verbal dome
queen adder
# rich adder thats why

well if it's a moving platform, and I make that platform a parent of my player, my player will stay on the platform, but it doesn't work the other way around

rich adder
#

and are you sure you parented to the rigidbody and not the parent or some other object without rb

rocky canyon
short hazel
random cave
rich adder
rocky canyon
lethal bolt
#

My units wont move to the towards the enemy.

#

Did i use transform wrong?

rich adder
rocky canyon
#

yea, i wrote majority of this my first 6 months of learning..

#

not sure i even knew what a coroutine was back then

rich adder
#

Update works fine, I just have a dedicated Routine because I also do a physics casts from the "legs" because it detects legs for my enemy so they can be tackled

eternal needle
# lethal bolt

Are you sure this code is even running? Add debugs to see. Likely a problem with the agent or the SetDestination. Check to see what this position even is.

rocky canyon
#

haha

rich adder
rocky canyon
#

zeros at heart ofc 😄

rich adder
rocky canyon
lethal bolt
#

They get the target but can't seem to walk towards it?

rich adder
rocky canyon
#

^ navmesh have lots of gizmos you can use to debug what ur navmesh is doing

rocky canyon
#

yea, i need to.. just been procrastinating..

verbal dome
#

Makes it less framerate dependent too

#

Which is ideal for movement

rocky canyon
#

my recent projects i have adopted MoveTowards

lethal bolt
rocky canyon
#

i replaced almost all my lerps with those instead

rich adder
#

or just use the coroutine method

lethal bolt
#

Do i need to bake every frame?

rocky canyon
#

altho even using movetowards i get people saying.. Use SmoothDamp instead!

#

lol

rich adder
swift crag
rocky canyon
rich adder
#

has actual decent articles

rocky canyon
#

yes i was just typing that same thing

#

really good source for Text style beginner stuff

rich adder
#

the OG

rocky canyon
#

catlikecoding wants to know ur location

rich adder
#

catlike is great , catlike gets right down to the basics though which is good and bad

#

hes like Yea...Unity gravity is ok.. but lets make our own..

rocky canyon
#

true, true..

#

unity gravity is broken...

#

should be defaulted to 10.5 instead

rich adder
#

me looking at the buoyancy script UnityChanPanicWork

rocky canyon
#

or 11 or 12 even

lethal bolt
#

This should work??!

rich adder
#

in playmode navmesh agent tells you exactly what its doing

lethal bolt
rocky canyon
#

^ it'll show u a little crosshair type thing where the navmesh is directed to go..

#

i dont have a navmesh in my project or i'd show u real quick

rich adder
lethal bolt
#

So always im using the Animator

rich adder
#

I dont see the typical red target when agent has a path

swift crag
#

You have to turn that overlay on

#

oh lordy

#

hit ` to get the list of overlaps and turn on AI Navigation

#

Ah, there we go. Docking the menu to the side makes it show up much better.

rich adder
#

UX program fail

#

reminds me when unity would fuck up arrays in the inspectors

lethal bolt
#

Like that?

rich adder
#

yup

#

so its not moving at all ?

lethal bolt
rich adder
#

idk what that means

lethal bolt
#

yes...

#

It wont move toward the Enemy even tho it has an target

rich adder
lethal bolt
#

No... Its just an visual

misty coral
#

If I make a collider a trigger can anything go through it?

rich adder
rich adder
#

thats the whole point of a trigger

lethal bolt
misty coral
# rich adder yes

I am having a problem where I can go through it but my enemy AI cant

#

and idk why

rich adder
rich adder
lethal bolt
#

Yes i dont know why, but it moves

#

So it isnt always in it

rich adder
#

you should exclude any moving objects' layers from the bake

rocky canyon
lethal bolt
lethal bolt
rich adder
#

yes you shouldnt bake layers with moving objects

lethal bolt
#

Oh, is there away i can bake without it leaving an spot?

rich adder
#

yes exclude that layer from the baking

rocky canyon
#

if theres something that moves that u need to account for you can use the Carve tick box

rich adder
rocky canyon
#

didnt know about that one 👍

lethal bolt
#

The spot is gone

#

👍

stuck palm
#

why arent they facing the correct way?

if (!paused)
            {
                if (facingleft)
                {
                    Quaternion targetRotation = Quaternion.Euler(0f, 0f, 0f);
                    armature.transform.rotation = targetRotation;
                    ultCameraContainer.transform.rotation = Quaternion.identity;
                    ultCameraContainer.transform.localScale = new Vector3(-1, 1, 1);
                    cameraContainer.transform.rotation = Quaternion.identity;
                }
                else
                {
                    Quaternion targetRotation = Quaternion.Euler(0f, 180f, 0f);
                    armature.transform.rotation = targetRotation;
                    ultCameraContainer.transform.rotation = Quaternion.identity;
                    ultCameraContainer.transform.localScale = Vector3.one;
                    cameraContainer.transform.rotation = Quaternion.identity;
                }
            }
rich adder
rocky canyon
#

ya exactly

rich adder
#

yeah carving during motion is probably expensive side 😛
use with caution

rocky canyon
#

havent really used the new navmesh components yet tbh

#

first time in that video ^

lethal bolt
#

But are they just really lazy or am i doing something wrong?

rich adder
#

at all

rocky canyon
#

the stopping distance.. affects it

#

in their minds they are close enough

rich adder
#

also that

#

just not going to target, you seem to have the wrong target

#

either that or ur moving the child while parent is elsewhere?

rocky canyon
#

i hate that ^ gets me once a week

rich adder
#

me when i try to duplicate an object but duplicated a child

rocky canyon
#

lmao facts!

primal lintel
#

guys, when I walk forward, after a few seconds my character falls

lethal bolt
# rich adder also that

Changing the stoping distance just made them really Physical agianst eachother. They dont move agianst the target att all...

#

But there is an arrow Coming from the Unit to the Enemy They just dont move

rich adder
rich adder
primal lintel
#

i resloved playerRigidbody.freezeRotation = true;

rich adder
#

those are constraints yes

ember tangle
#

When I inherit this interface:

public interface ICommand
{
    void Execute();
}```

its making me write the inherited method like this or I get errors:

public class FormationMoveOrder : ICommand
{
void ICommand.Execute()
{

}

}```
This is not what the documentation I'm following suggests is supposed to happen. Is the IDE correct anyway?

rich adder
#

same exact thing

lethal bolt
rich adder
#

the navmesh agent

#

and the target object

stuck palm
#

@slender nymph do you know how to disable ground snapping? the walkthrough says to do this but it doesnt exist

slender nymph
lethal bolt
swift crag
sterile plover
#

on my mouse scrolling input the mouse scroll is very laggy like i need to scroll for like 4s to make the input move by a Nano centimeter i cant understand a thing where this thing comes from, is there a way to modify the sensitivity or smth like that ???

ember tangle
swift crag
#

oh, it's implementing the methods explicitly

#

the IDE should offer to do both

slender nymph
#

oh right, it's gotta be public

swift crag
#

ahh

#

good catch

ember tangle
rich adder
sterile plover
slender nymph
lethal bolt
#

Ig ill figure it out tomorrow its getting late

rich adder
sterile plover
rich adder
#

you're talking about the Orbital camera or what

swift crag
#

perhaps you need to change the sensitivity, then

sterile plover
#

and when i scroll like it doesnt activate the scrolling input everytime

sterile plover
#

here is the input for the mouse controls for the cinemachine camera if it can help

#

like yk when you use your scroll wheel the value goes to 120 or smth like that right ???

#

but here it goes to 120 times to times when it want, but im actually scrolling like a mad man

stuck palm
slender nymph
#

i don't know off the top of my head. there's an entire forum post for the asset though, you could try looking there

stuck palm
#

well my code needs refactoring i mean

slender nymph
stuck palm
#

to fit it, not too much though luckily

slender nymph
#

this is all i did to add my own sensitivity to it:

public class InputProvider : CinemachineInputProvider
{
    public override float GetAxisValue (int axis) => base.GetAxisValue(axis) * GameSettings.MouseSensitivity;
}
sterile plover
#

like my issue is that the input dont detect when my mouse scroll is used like it should normally do

#

and i tried 2 different mouses and made the same issue

slender nymph
#

what did you actually set the scale for the Y axis to? and keep in mind that if you are using the scroll delta the values might be super small, you could always try printing them to see what they actually are

sterile plover
slender nymph
#

you literally just said you tried the scale processor

sterile plover
#

made the movment slightly bigger but not really any changes

slender nymph
#

then print what the values actually are

stuck palm
sterile plover
slender nymph
#

just print it in OnLook, you don't need to assign it in OnLook then print in Update

#

but that's literally how. all you need to do now is make sure that you have subscribed to the event somehow, such as with the PlayerInput component

sterile plover
#

i dont know how to assign the right input

slender nymph
#

😮‍💨
remember how i suggested you read the documentation on the input system and you said you would?

sterile plover
#

in the input header in the editor there is no assign for any input

slender nymph
#

why would there be one there?

sterile plover
#

to know which input i am printing ?

slender nymph
#

oh and the component will not magically grow new properties to assign in the inspector just because you thought about input when making that component

sterile plover
#

and sry for the documentation thing tbh i just checked what i needed for the input to be assigned differrntly between X and Y etc.. (but yeah that is not an excuse)

sterile plover
slender nymph
#

surely you bothered reading your screenshot, right?

sterile plover
#

yes ?

slender nymph
#

so then based on what you see in that screenshot, what do you think you forgot to do?

sterile plover
#

the "No Function" but when i click on it the only option i have is a string name

slender nymph
sterile plover
rocky canyon
#

u drag in the gameobject w/ the script on it..

#

not the script from the project window

sterile plover
rustic valve
#

Someone knows why my unity predictions stopped working? (even my extensions (like error lens) doesnt do anything):

rich adder
slender nymph
#

#JustVSCodeThings

rustic valve
slender nymph
#

is your Visual Studio Editor package up to date?

rustic valve
#

how can I check it ?

slender nymph
#

look in the package manager

rocky canyon
#

package manager..

rich adder
#

looks like external tools says package version 2.0.22

rocky canyon
#

u want the 2.0.22 version

sterile plover
#

WTF WHAT THE HELL HAPPENED ??!!? now it work normally without any lag ??? the only thing i changed was to add a print script and add the player input component 😭
why does the was lagging without the player Input ???

rustic valve
#

it was installed

rocky canyon
#

vscode can be finniky when recompiling and whatnot

rich adder
#

it might cause issues

rocky canyon
#

sometimes u gotta tab back and forth from unity to vscode to str8n it out

slender nymph
rich adder
rustic valve
#

it can't be removed Sadge

rich adder
slender nymph
sterile plover
rocky canyon
slender nymph
rich adder
sterile plover
rustic valve
slender nymph
slender nymph
summer stump
rich adder
#

^ also try using the solution explorer and open script from there

sterile plover
slender nymph
#

well that doesn't seem right 🤔

#

i'd try and see if you can reproduce this behavior in an empty project and if you can reproduce it, then submit a bug report

rustic valve
sterile plover
stuck palm
slender nymph
hollow dawn
rocky canyon
#

well, for starters u have a function called JumpAddForce() that your code never uses..

slender nymph
#

this person really needs to start paying attention to the code they are copying

rocky canyon
#

i could see tht

summer stump
rocky canyon
#

it may be past the point of no return.. but imo its better to get ur controller working first.. (without) any kind of animations.. and then add those once u have a working controller w/o problems..

summer stump
#

You are also doing velocitychange in move..

And you could just... remove the part where you set gravity to true. The issue before was setting it false, the solution was to remove that, not change it to true

rocky canyon
#

hmm wasn't aware these were public

#

no clue, i dont write shaders