#šŸ’»ā”ƒcode-beginner

1 messages Ā· Page 218 of 1

wind raptor
#
[SerializeField] bool* someBooleanCallback;
[SerializeField] void* someVoidCallback:

void Update(){
  if(something) someVoidCallback();
}

I know this isn't the right syntax, but what terms should I be looking for to accomplish this?

buoyant knot
#

the direct answer to your question, is it depends… on the units of what you have

queen adder
#

bool * ?

#

This is not C or C++

short hazel
#

mmm pointers

buoyant knot
#

serialize a pointer lol

wind raptor
#

I know, wrong syntax, but that's the concept I'm trying to accomplish

queen adder
#

No bro lmao

rocky canyon
#

public UnityEvent onCustomState1;

queen adder
#

Just do the type and youll get ur reference

buoyant knot
#

that way, the bool* can point to a memory address on my computer, I build, someone opens it on their switch, and then it accesses the memory of the same address and seg faults angerjoy

grim raft
#

Ok, so when I'm applying forces to an object in general I do not need to multiply the forces bt Time.deltatime (?)

short hazel
summer stump
rocky canyon
#

otherScript.DoSomething();

#

ur switch statement could call w/e

#

at this point im confused on how ur project is set up.. lol

queen adder
#

Just derive from UISelectable

#

U wont need a reference to a button them

rocky canyon
#

but what if he wants to disable the button at anytime.. that script would have to be on the button itself

queen adder
#

Selectable = false

#

He doesnt have to disable the script to turn of the button

rocky canyon
#

ah thats true

queen adder
#

I believe hes left

wind raptor
#

Sorry, no still here

rocky canyon
#

to get ready to publish i bet ;D

queen adder
#

But if he comes back just look into UISelectable

#

Oh sorry

rocky canyon
#
using UnityEngine;
using UnityEngine.UI;

public class ButtonController : Selectable
{
    private enum ButtonState
    {
        Unpressed,
        Pressed,
        Latched,
    }

    private ButtonState currentState = ButtonState.Unpressed;

    protected override void Start()
    {
        base.Start();
        onClick.AddListener(OnButtonClick);
    }

    private void OnButtonClick()
    {
        PressButton();
    }

    public void PressButton()
    {
        currentState = ButtonState.Pressed;
        PerformAction();
    }

      ....etc
wind raptor
buoyant knot
#

if the formula you write when adding force does not have those units, what will happen is that you will tune the numbers until they look like they work right, and then later in development when numbers change, everything will break again. Because the formula (with wrong units) is wrong

rocky canyon
buoyant knot
#

this applies to any physics code you write. It MUST obey units, or the result is guaranteed to be incorrect

#

if you write:
rb.velocity = transform.position - secondTransform.position;
i just wrote meters to speed, but speed is m/s. This will be wrong

grim raft
wind raptor
#

Alright yeah, UnityEvents are definitely what I was after, but I will do some looking at the Selectable class.

buoyant knot
#

and just looking at youtubers who say ā€œyou need to multiply by delta time for it to be consistentā€ is bullshit, because that is not how it works

rocky canyon
#

UnityEvents are awesome/ lazy šŸ˜› j/k

wind raptor
grim raft
#

I just can't really understand at 100% how do Update differ from FixedUpdate and in which cases I should use Time.deltaTime or Time.fixedDeltaTime

wind raptor
#

And thanks @queen adder whoever else

queen adder
#

The Selectable class enables u to use UnityEvents

#

The Selectable class just lets u make a Button but with extra logic

queen adder
#

Well really ANY class can use UnityEvents

buoyant knot
#

so you can be running at 500 FPS vs 60 FPS, and still maintain 30 fixed frames per second

rocky canyon
#

if u set a RB velocity in update tho it'll wait until the next fixed update before it actually impacts the RB

buoyant knot
#

at 500 FPS, you call Update 500 times, and FixedUpdate 60 times.
At 100 FPS, you call Update 100 times, and FixedUpdate 60 times

#

per second

grim raft
#

Is it ok to perfrorm some math like this in FixedUpdate?

polar acorn
buoyant knot
#

right. depend on settings

rocky canyon
#

nuh uh

buoyant knot
#

point being, fixedupdate is on a fixed schedule

#

Update is not. And you can sometimes get a lot of Update calls between physics simulation steps, and sometimes not so many Update calls

rocky canyon
grim raft
#

Thank you all for your helpāœŒļø

rocky canyon
#

it is calculations for the physics after all

buoyant knot
#

as a general rule, you should only touch rigidbody fields/parameters with setters in Update (or non fixed update frames) IF you are initializing (or related non-physics movement)

grim raft
#

Does anyone also know something about this?

lost anvil
rocky canyon
#

might be somehting to do with this

lost anvil
#

well yeah but i dont know what that is

rocky canyon
#

scripts dont run like they should when they're popping Null errors all thetime

buoyant knot
#

so you should not be modifying rb.velocity or rb.position, or calling rb.AddForce or rb.MovePosition in Update

buoyant knot
rocky canyon
buoyant knot
#

if you get a null reference exception, usually everything in the game is about to break

rocky canyon
#

script go bRrrrrrrrrrr

buoyant knot
#

because you’re usually breaking out of a lot

polar acorn
buoyant knot
#

like cutting off the program halfway through a frame

#

double click on the error, and it will take you to the problematic line of code

#

it also tells you that the error is on line 43 of that file

rocky canyon
#

hinge;

#

where do u assign hinge

#

ohh i see it nvm

wind raptor
#

Okay, so another basic question regarding how events work...

  Button button = GetComponent<Button>();
  void doThingWhenPointerDown(){ }
  //make button.OnPointerDown cause doThingWhenPointerDown()
#

What's the syntax there?

lost anvil
buoyant knot
#

then you best figure out why doorSound or doorClips of that index are null

rocky canyon
buoyant knot
grim raft
#

Are also raycasts called every physics frame?

wind raptor
#

Sweet, thank ye

queen adder
#

Oh i was so confused

#

Thats redundant tho

rocky canyon
queen adder
#

Why not just put the method via the inspector

summer stump
#

Might be every frame if it's in update

buoyant knot
rocky canyon
wind raptor
buoyant knot
#

the computer will not ask questions if you raycast in update, but we will judge you

rocky canyon
#

lmao

#

hides code

grim raft
#

I'm creating a car and I'm actually setting the wheels positions using raycasts

rocky canyon
#

cool. i do that for suspension

timber comet
rocky canyon
#

sure

#

see it all the time

grim raft
#

I noticed that using raycasts in Update() works fine for setting that positions

queen adder
#

Ppl use Raycast In Update All the Time?

grim raft
rocky canyon
buoyant knot
rocky canyon
#

like when u click mouse -> raycast into the scene -> get position

queen adder
#

Ppl use Raycast for other stuff to

rich adder
#

not only. I use it for checking slopes, climb mechanic etc

buoyant knot
#

in general, if you are using old input system, you want to store logs of input in Update, and then action on physics queries linked to them in fixed update

queen adder
#

I cannot remember the effing name

ashen wind
#

how do you change the render order of ui elements?

queen adder
#

Stealth Games

timber comet
rocky canyon
rich adder
timber comet
ashen wind
#

i mean how to do it from script

rich adder
eternal needle
ashen wind
#

you can switch the child order in code?

rich adder
buoyant knot
#

if you use the new inputsystem, you invoke a function, I’ll normally store input variables there, to then do stuff based on input variables in fixed update

ashen wind
#

setsiblingindex?

rich adder
#

yup

ashen wind
#

sweet

buoyant knot
#

but i would rather do any sort of casting in fixed frames only

rocky canyon
buoyant knot
#

casting in Update is bad juju, because you are querying while things could be changing leading up to a physics sim step

short hazel
#

There's absolutely nothing wrong in using Raycast in Update, because the result is instantaneous.

buoyant knot
#

you usually only run physics queries for physics reasons

rocky canyon
eternal needle
#

Especially if you're checking for the floor.. it doesnt matter because the floor doesnt move

grim raft
queen adder
#

Raycast arent that slow

eternal needle
buoyant knot
eternal needle
#

It would look like shit if an object moved in update while the wheels move in fixed update

short hazel
#

Where it causes issues is when stuff is applied over a few frames, like an AddForce call. If the framerate is inconsistent, the applied force smoothed over a few frames will appear inconsistent. But not for one call, an instant velocity change, or a physics cast

rocky canyon
#

ill keep casting in update 😈

ashen wind
#

god bless the person who thought to code the SetAsLastSibling function

timber comet
timber comet
rocky canyon
#

wtf is creating a void ?

buoyant knot
#

every time I try casting in update, I get the ā€œold infoā€ problem, where the timing in frame doesn’t match what is going on with the rbs

queen adder
#

I think he means a void Function

rich adder
#

man if he created a void we'd all get sucked in

timber comet
rocky canyon
buoyant knot
#

because you can be moving rbs within fixedupdate

summer stump
rocky canyon
summer stump
#

And yeah, new input can be callback driven

buoyant knot
rocky canyon
#

i gotta learn the new input system (╯°▔°)╯︵ ┻━┻

queen adder
#

Its not hard

rocky canyon
#

i feel overwhelmed

queen adder
#

Ur a pretty good coder Spawn so youll prolly learn it pretty ez

buoyant knot
#

if you fuck up slightly with a dynamic rb using box2D, unity will automatically depenetrate you before it does anything

short hazel
# timber comet Yes

Method. void is the return type.
What do you call this:

int GetNumber() { return 42; }

An "int"?

rich adder
rocky canyon
#

lol sure thats what it is ;D

rocky canyon
timber comet
buoyant knot
#

this happened to me a lot before I made my custom physics engine, where Unity’s box2D usage would fix a lot of my sloppiness

queen adder
#

It is way more complicated

queen adder
#

And honestly the API is not that great

#

Trying to set up KeyBinds at runtime is fucking annoying

timber comet
rocky canyon
#

okay.. okay.. my next prototype ill use it

#

promise

buoyant knot
#

new input system is more complex, but it is so much better, because you can tie functions to events for specific inputs

rocky canyon
#

ya its hella expandable

rocky canyon
#

method is 2 letters more

timber comet
rich adder
#

in new Input system You can do polling too if you're used to that

buoyant knot
#

instead of checking ā€œiS tHiS buToN dOwN nOw?ā€ every goddamn frame, in every script that responds to input, like a buffoon

#

that pisses me off so much

rich adder
#

if(Keyboard.current.qkey.WasPressedThisFrame)

rocky canyon
timber comet
queen adder
#

Honestly i like using UnityEvents the new input system

rocky canyon
timber comet
#

Not if you press from any other input device

rich adder
#

iirc

#

I just use the Messages though so its no problem

rocky canyon
#

true.. but im not developing for controllers..

queen adder
#

Its really intuitive you just write a function and it gets called

rocky canyon
#

KBMR!

short hazel
queen adder
#

No Update no references

short hazel
#

So yeah nice excuses my man

queen adder
#

Just call a function when the key is pressed

buoyant knot
#

my issue is that the new input system would benefit from more documentation/help. going through youtube guides is necessary, and also makes the process way hardee than it needs to be

rich adder
timber comet
rocky canyon
rich adder
timber comet
buoyant knot
#

inputsystem is just better than input

buoyant knot
queen adder
#

It comes with its own complexity tho

short hazel
rocky canyon
grim raft
rocky canyon
#

aye, nice.. as long as it works.. it works

queen adder
#

Lmao

timber comet
summer stump
short hazel
#

Paradoxical type, void is a return type, that indicates no return value

#

Describes something that doesn't exist

queen adder
#

Bro it was a simple mistake lmao

short hazel
#

Yeah?

queen adder
#

Why are yall going off on him

short hazel
#

I'm not

rancid tinsel
#

any idea what this means and what I should do?

timber comet
rocky canyon
#

šŸ˜„

queen adder
#

For sure lmao

rocky canyon
#

we're doing a service

#

then he can be grammar police w/ us

buoyant knot
#

void isn’t a return type. it is a keyword for ā€œnothingā€

frigid sequoia
#

Shouldn't this work?

rocky canyon
buoyant knot
short hazel
rancid tinsel
rocky canyon
buoyant knot
frigid sequoia
timber comet
frigid sequoia
#

I am really confused

short hazel
#

Using Java naming in C# is a clear violation of the Geneva convention

buoyant knot
#

that is the Array class

#

Array is a class in System

#

arrays are not Array

rancid tinsel
#

and it's been working fine until today

short hazel
#

You can use Array like that? Hang on what

queen adder
#

Array.Add is real ????

short hazel
#

No you can't

rocky canyon
buoyant knot
frigid sequoia
timber comet
slender nymph
rocky canyon
buoyant knot
#

the whole point of an array is that its length does not change

short hazel
frigid sequoia
#

Then I have to change these to Lists?

buoyant knot
#

you cannot change the length of an array. that requires you to make a whole new array

rocky canyon
#

you should use lists yes

#

if u plan to add and remove

#

if u need a fixed length list then use an Array

queen adder
#

Lists are better for games in general IMO the performance cost is worth it

timber comet
rocky canyon
#

i always use lists for some reason

buoyant knot
#

the whole point of a List is that you can .Add and .Remove entries.

#

Lists have other features, but the main feature is .Add and .Remove (RemoveAt)

timber comet
frigid sequoia
#

Can I add a LIst to the materials? I though it only accepted arrays

rocky canyon
static bay
rocky canyon
#

ohh u named it material.. mb

#

u got the type right.. im blind

timber comet
rocky canyon
#

i know right.. šŸ˜… sorry

buoyant knot
#

List<Material> material = new List<Material>();

#

forgot ()

rocky canyon
#

@rancid tinsel is that helpful?

short hazel
timber comet
rocky canyon
#

nah fk js

#

and fk boo

#

and monoscript

buoyant knot
#

row row fight the power

timber comet
rocky canyon
#

oh wait im thinking of something else i think

frigid sequoia
#

Also, arrays aren't ordered rigth?

rocky canyon
#

it was that language that they used that was based off JS i thik

#

UnityScript šŸ¤¦ā€ā™‚ļø

rancid tinsel
#

thanks

rocky canyon
#

np šŸ‘

timber comet
#

Do you know what’s an assembly definition? I saw it in unity’s microgames

buoyant knot
#

what does ordered even mean?

rocky canyon
#

ofc they're ordered

buoyant knot
#

you just put things jnto different indices

rocky canyon
#

0,1,2,3,4... etc

buoyant knot
#

that isn’t an order. it’s an index

rocky canyon
buoyant knot
#

because the array is just a pointer, and an index takes you straight to a spot in memory

rocky canyon
#

when Unity recompiles.. it recompiles each assembly def

queen adder
#

Not true

rocky canyon
#

so if u use multiples u can keep it from compiling ALL ur code

frigid sequoia
#

Like this then?

queen adder
#

It will actually only changes the ones that have been modified

buoyant knot
#

unity only recompiles assemblies that changed, or assemblies that depend on ones that changed

#

that’s half of the point of using assemblies

timber comet
rocky canyon
#

ya that ^

#

and organization

queen adder
#

Yes

#

But keeping up with namespaces can be annoyin

buoyant knot
#

the other half of why you want assemblies is to break shit up, and especially to use the internal keyword

queen adder
#

You can get namespace conflicts super easily

rocky canyon
#

just dont worry about assemblys just yet

buoyant knot
#

if you don’t use assemblies, internal might as well be public

rocky canyon
#

in the future u may want to go back and learn em/ use em

timber comet
#

Thanks for the help

buoyant knot
#

you can wait until a lot later tbh

timber comet
buoyant knot
#

part of an assembly is how dependencies work

short depot
#

hello is there a support channel here?

slender nymph
eternal falconBOT
#
Where can I get help?

Take a look at #šŸ”Žā”ƒfind-a-channel

:warning: This is not a channel for official support.

Please do not ping admins, moderators, or staff with Unity issues.

timber comet
buoyant knot
#

if I have Class A which depends on Class B, and B also depends on A, then they MUST go into the same sssembly

short depot
buoyant knot
#

and if this becomes a more complex web, then you will quickly find yourself with one gigantic assembly anyway

buoyant knot
#

no

#

if in my file for Class A, there is any reference at all to the existence of class B, and visa versa, then they must be in the same assembly

#

point being, don’t worry about assemblies, and writing code that satisfied requirements for assemblies until you get way deeper in.

timber comet
buoyant knot
timber comet
buoyant knot
#

i’ve been working on a project for 6 months. Still one major assembly. recompile is still like 5-10 seconds

#

i broke up a couple of smaller things into a separate assembly, and also my editor code into a separate editor assembly. Still mostly the same

hybrid gust
#

If I want to control the flow orf a minigame, darts for example. Would using something like a FSM be the way to go? I feel like it would be, but I felt like I should ask just to make sure there isn't a simpler / better way to go about it

shell sorrel
#

i never really found splitting asmdefs to really help compile times

#

i just do it for organizational purposes and limiting scopes, also unit testing

queen adder
#

Tbh same

#

Unity is just slow in general lmao

shell sorrel
#

on a bigish project, it starts compiling when i hit save, generally done or close to when i swap to unity

rocky canyon
#

all engines get slow while u build up the project

queen adder
#

Unity is slow from the start

shell sorrel
#

its faster then C++ compiles for unreal

queen adder
#

Godot compiles much faster from my experience

shell sorrel
#

defiently faster then any in house engine i used

#

have found the faster your storage the better

static bay
#

Game changing shit.

queen adder
#

Oh yeah hot reloaders are pretty cool

#

I should look into that

shell sorrel
#

my old work machine was getting pretty horrible compile times, but it was a old iMac that still had a fusion drive, instead of pure ssd. new one is ultra fast

queen adder
#

Unreal engine hasnt been to bad from my experience with compile times either

buoyant knot
#

the biggest thing that slows me down is reloading domain tbh.

#

and I’d rather spend an extra 5 seconds each time, than deal with the risk that build does not match edittor because i did not reload domain’s static variables.

shell sorrel
#

what hardware are you on?

#

also a big upside i have is rider tells unity to start compiling on save, so i am not switching to unity then haveing it start

violet rose
#

rider's unity integrations have gotten so good

queen adder
#

The fact that some Third Party treats C# better than microsoft is very effing telling

shell sorrel
#

feel i get about 2 or 3 seconds on both of my machines, my mac is a M2 max 64gb ram

#

and my PC is a ryzen 9 7950x 64gb ram

shell sorrel
hybrid gust
shell sorrel
#

i use there Rust, Go, and C ides as well

queen adder
#

I took their Programming Course

#

And thats the only way i learned programming lmao. Granted it was Kotlin but the stuff they make in general is pretty good

shell sorrel
#

yeah not a fan of JVM, but that aside kotlin is a cool langauge

queen adder
#

If rider didnt have a fee i would use it

shell sorrel
#

have only used it sofar for making jetbrains plugins though

#

ah i just have the all products pack, think it costs me like $140 CAD per year

vast vessel
#

sooo i want to use git LFS with github desktop.
ive downloaded git LFS
ive installed git LFS
and ive added all the file types i need with git lfs track "*.extentionGoesHere".

so now, i have this already existing repository on github desktop that is fully local and nothing has been pushed yet.
so if i push to origin right now, will it use git LFS, or do i need to do any more configuration?

shell sorrel
#

good tools are worth the money, i spend 40 or more hours a week doing dev

timber comet
queen adder
#

It is yeah

#

It pretty much updates you about Editor Values and intergrates really well with the editor

#

Its one of those things where u once u have it you cant live without it

#

Its much better than VS

shell sorrel
#

so before rider existed, i was literally running a whole windows VM so i could run vs + resharper for unity ios dev

#

and pretty much once rider came out i never looked back, what i use on both os's now

#

now comment i will make, its a total ram hog

#

like you will want 32gb or more for doing unity stuff with rider

hybrid gust
queen adder
#

Yeah sorry

hybrid gust
#

np, thanks šŸ™

hybrid gust
#

Sall good

orchid trout
#

dumb question, why can't I name a method '1D' ? I assume because 1D has some kind of special meaning?

hybrid gust
#

Can't start things with number iirc

orchid trout
#

Ooh its the number tripping it? I see

shell sorrel
orchid trout
#

Ah yeah D1 is just fine

shell sorrel
#

or prefix with something else

#

its just a parsing thing, starting with a number it thinks you are doing a literal

hybrid gust
#

Also @shell sorrel and @timber comet I should apologize, I just now saw that #1157336089242112090 is a thread channel, I didn't mean to suggest it to be an ass or anything

orchid trout
#

I was using it for a dice roller like
int result = D(20) + 5; (the method was just called 'D'

timber comet
orchid trout
#

hm I can make it XD(1, 20)
typing XD makes me feel dirty though UnityChanThink

shell sorrel
orchid trout
queen adder
#

Yeah mayo dont sweat it lol we understand

#

Ur not an ass

spark lantern
#

Hello, I'm trying to make my character move like Sonic (that is, when he walks he starts slow and goes faster and faster, and when he stops he returns to his initial speed) The code works, he increases his speed etc, but it's supposed to that when you stop, your speed returns to the initial one, which does not happen

timber comet
queen adder
#

He does With Input.GetKeyNone

timber comet
#

You need to to use: Input.GetKeyUp()

vast vessel
timber comet
queen adder
#

Oh?

spark lantern
#

thx

timber comet
polar acorn
queen adder
#

Yeah lmao im so dumb for that

timber comet
chrome veldt
#

how do i uh, make 3d third person camera?
i was following a tutorial, but it got confusing mid way through

polar acorn
#

I can get checking GetKey, because "Are you currently pressing no key" at least makes a bit of sense

polar acorn
#

But how would you have pressed the none key this frame?

timber comet
chrome veldt
timber comet
slender nymph
chrome veldt
#

ok, thx

sage slate
frigid sequoia
#

Can I use the destroy method to destroy just the script that is running it?

sage slate
#

yes

timber comet
frigid sequoia
#

Oka thxs, I just used Destroy(gameObject) up until now

sage slate
#

also fine if you have just this one script on it
i tend to make many game objects with only one script so it's easy to pick the right one in the hierarchy by naming the game object accordingly

timber comet
rich adder
#

TryGetComponent

zinc osprey
#

Hi, can I flip the faces of an UI Image?

frosty hound
#

What faces?

zinc osprey
#

This is now facing the camera.

#

When I rotate it like this, it's now facing away.

frosty hound
#

Rotate it 180 on the y axis only?

#

Not sure why you're also rotating by 90 on the z

#

But if you want to flip something visually, you can set the x-scale to the negative value instead.

zinc osprey
#

to make it fit into the whites squares

frosty hound
#

Ok then I'm completely missing what you're asking.

zinc osprey
#

I don't know how to explain it without video, but changing the scale worked

#

Thanks

calm hull
#

why this name appears as (Clone)? The class is a child of a general class, could it be cause of that?

night mural
calm hull
#

how could i fix it?

night mural
#

fix what? it's not broken...set the text to be something else if you want it to be something else, or name the object when you instantiate and use that name

calm hull
#

yes, i want to only appear the name of Allie1, without the clone

night mural
#

you could also create your own DisplayName property intead and use that

calm hull
#

like a getName(){

rich adder
ivory bobcat
dusky dirge
#

Hey I'm new to unity and I need some advice

I'm making a game where you have a base, and then you can choose to explore in a randomly generated terrain, as you get either teleported to the terrain or it switches scenes

Would it be better to put the base and the randomly generated terrain in separate scenes or in the same one? My game is 3d.

If you need me to elaborate further lmk and I'll try my best

calm hull
#

how do you check the values of a variable while running the game? i know there was a thing to put in front of it but dont remember

rich adder
#

Break Points? Debug.Log?

calm hull
#

yea how can i debug log

rich adder
#

Debug.Log(someVariable)

#

You can also view non-local variables inside the inspector

#

private ones can be seen with SerializeField or Debug mode in the inspector

rich adder
calm hull
#

why red?

empty dust
#

should i write a new script for player combat or add it to my playermovement

calm hull
#

yea System.Diagnostic.Debug

rich adder
#

also

#

You cannot use outside a method, ie where you declaring variables

calm hull
#

iu see

#

was that

#

i iused it out of a method

#

TY

rich adder
#

that will just log the object though

#

if you want to see your list in the inspector btw you can serialize that

#

make it public or [SerializeField] private šŸ‘ˆ better

plain mural
#

I'm trying to make a main menu but am having some trouble can someone help me?

rich adder
#

easier to extend or debug stuff later on

empty dust
#

okidoke thank you

#

yeah lot less messy

empty dust
#

trouble how?

plain mural
#

Ok, well I am trying to get the play button of my Main Menu to go to the next scene but it doesn't really work whenever I build my project.

rich adder
#

does it work in editor

plain mural
#

No it doesn't work on Editor

#

Idk if there is anything blocking in the editor

rich adder
summer stump
plain mural
#

I put it in a Canvas

#

Oh, I added an Event System just now

lost anvil
plain mural
#

What do I do with it?

summer stump
calm hull
#

Why onClick() dont work? (its not adding to list)

plain mural
#

Ok I added an Event System but it's still not working

rich adder
plain mural
#

No, I don't see any hovering

rich adder
#

put Debug.Log inside make sure is working

summer stump
summer stump
calm hull
#

its a Ui botton, do i need a event system?

rich adder
rich adder
summer stump
#

Like buttons

calm hull
#

oh i thought with the OnClick was enough

summer stump
#

Events are usually named "On" something

plain mural
calm hull
#

then i have a event oClick() yes

summer stump
#

To make the OnClick event work

rich adder
# plain mural

you didnt have to put on a button lol just root of scene was fine

summer stump
rich adder
#

it is it seems, lower on hierarchy = drawn last so they should be on top. Doesn't hurt to disable Raycast target on those though

#

Your highlight color is white...how could you tell it was hovering or not šŸ¤” @plain mural

rich adder
calm hull
rich adder
# calm hull

fyi event system goes at root of scene not on button

#

if you disabled a gameobject button the whole canvas breaks

calm hull
#

so i need to put the event outside of the botton?

#

how i put it on a scene

plain mural
#

Which one of these is the hovering button color?

#

Cuz when I try it again the color doesn't change

rich adder
rich adder
lost anvil
calm hull
#

so once i create it out, i put inside it the botton right?

rich adder
# lost anvil how do i debug that

start logging what it is your code is actually interacting with, never make assumptions. Visuals can be deceiving sometimes compared to what code is doing

calm hull
#

sorry im a bit messed

plain mural
#

Yeah unfortunately it still doesn't work

rich adder
plain mural
#

Even when I change the Highlighted Color

#

I wonder if the Background is covering the button?

rich adder
#

it tells you exactly what you are hovering

calm hull
rich adder
#

2 people with the same problem, no shite..

#

lol

plain mural
#

There are 2 event systems in the scene. Please ensure there is always exactly one event system in the scene
UnityEngine.EventSystems.EventSystem:Update () (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:543)

calm hull
#

xD

plain mural
#

Apparently this is what I get

rich adder
#

again the one added with the + button should be there only , at roo of scene

calm hull
#

but how you connect it to the botton, once is already at root

rich adder
#

During Playmode, You can inspect this object and tells you exactly what ur hovering

queen adder
#

The error tells u what to do?

dreamy fulcrum
#
    {
        HingeJoint2D[] hingeJoints = GetComponentsInChildren<HingeJoint2D>();

        foreach (HingeJoint2D hingeJoint in hingeJoints)
        {
            JointAngleLimits2D limits = hingeJoint.limits;
            limits.min = limits.min + angleOffset;
            limits.max = limits.max + angleOffset;
            hingeJoint.limits = limits;
        }
    }
}```
Im trying to write a script where i set the lower angle and upper angle of my hingejoint2D to its original value + 180 (angleOffset) but i cant find a way to stop it from continuously adding 180 to the angle limits (it's triggered if GetAxisRaw is < 0f)

Any advice?
rich adder
#

Inspect the Event system during Playmode to see what its hitting @calm hull @plain mural

calm hull
#

that appears when debug right?

rich adder
#

no, that appears when you just run the game

#

and inspect the event system object

calm hull
rich adder
calm hull
#

tnat are the ones i have

rich adder
calm hull
#

the script

queen adder
#

Where it says event system

calm hull
#

ohh

queen adder
#

You can click it

#

Yuh

calm hull
rich adder
# calm hull

not sure what this screenshot is supposed to do?

queen adder
#

There that's all the info u need for the UI

#

It tells u everything

rich adder
#

you're supposed to utilize it and hover the button to see what it says

plain mural
rich adder
calm hull
#

nothing appears when hover the b8otton

rich adder
#

Attack 3

#

it says it right there

calm hull
#

thats the botton name

rich adder
#

that means its reading whatever is on it

#

as UI

#

so that aint the issue

#

put Debug.Log inside your function like I said earlier and click the button , check the console

calm hull
#

nothing appears on console

#

its not entering the method

rich adder
queen adder
#

PointerEnter shows what ur hovering

plain mural
#

Apparently in the bottom right the EventSystem doesn't show up

queen adder
#

Pointer being the mouse

#

Click on the EventSystem gameobject

#

Then it will show

plain mural
#

Is there something where I can show the screen?

#

Cuz I think it's easier to get help that way

queen adder
#

Screen shot it?

#

OBS studio allows you to screen record

plain mural
rich adder
#

why do you have 2 scenes open, also remove the event system on the button..

plain mural
#

I had the actual game in the "Home" scene and the Main Menu in the "Main Menu" Scene

calm hull
#

i think its working!

#

wait let me check

queen adder
#

Nice!!

plain mural
#

Ok I removed the event system on the button

queen adder
#

Navarone also already said make sure the event system is in the root of the scene

rich adder
#

Add it from the + button and UI menu

slender nymph
# plain mural

do not put the Event System on the same object as something else with a preview and it won't be a problem. also you'd look at the preview during play mode, not edit mode

rich adder
#

then its easier to inspect cause is its own object

calm hull
#

its working

#

yeeeee

queen adder
#

Nice!!

calm hull
#

thanks guys

#

sorry for all that xD

queen adder
#

Ur good homie

rich adder
#

all good. Ui is confusing

calm hull
#

with that eventsystem will be enough for all bottons right

rich adder
plain mural
#

I changed it offscreen

#

Still doesn't work though even with the Highlight Color Change

rich adder
#

still doesnt what work? Im not inside your brain idk what u did

plain mural
#

I added the EventSystem in the Canvas

queen adder
#

Take a screenshot then?

plain mural
#

The hover doesn't work

rich adder
#

are you inspecting the Event System during playmode or what?

long spade
#

Hello, excuse me but can i ask a simple question?

plain mural
long spade
#

or its in other channel

plain mural
#

Yes I have been doing that for a bit

queen adder
#

You can ask ur question

rich adder
rich adder
calm hull
#

xD

queen adder
#

Screenshot ur highlighted colors...color

long spade
#

someone know why its blank? i tried making a new scene but nothing happends. im starting in unity but i cant get through it.

plain mural
rich adder
polar acorn
rich adder
# plain mural

you did not follow any of the instructions given to you did you

plain mural
#

Wdym

polar acorn
plain mural
#

It's in the left side

#

Do you not see it

summer stump
polar acorn
summer stump
#

Where?

#

I only see the hierarchy on the left

plain mural
#

EventSystem

#

What does this mean then?

summer stump
polar acorn
rich adder
summer stump
#

They want to see the debug information FROM the event system

#

And also, only ONE event system should be in the scene

#

Find the other and remove it

plain mural
#

Ohhhh

#

Wait I see it now

long spade
#

It worked! Thank you navarone and digiholic. sorry for bother tho.

summer stump
#

And also, only ONE event system should be in the scene

plain mural
#

Yeah only eligibleForClick changes

summer stump
#

You need to get rid of the other event system

#

Do that before anything else

plain mural
#

I already got rid of it

summer stump
#

Ah sorry- yeah just realized

rich adder
#

I cant see shit

summer stump
buoyant knot
#

where are the VS settings in windows to change things like formatting?

polar acorn
#

Particularly that "Current Raycast" bit

buoyant knot
#

trying to reconfigure IDE on my new windows machine

#

and menus differ from mac

buoyant knot
#

ty

#

it’s in a very different place from mac lol

#

i also see way more features in VS for windows

plain mural
#

Is this good enough?

rich adder
#

and read Current Raycast

plain mural
#

How do you scroll down in the preview?

#

Event System I mean

rich adder
#

just keep it expanded there is no need to scroll

plain mural
#

Yeah there is no change in anything

#

Whenever I click

#

In Current Raycast

calm hull
#

not click

#

hover

plain mural
#

Yeah, no change even in hover

rich adder
plain mural
#

You get the Graphics Raycaster in the Inspector right?

#

Cuz in that case... yes

rich adder
#

can u make another video with event system info expanded hovering buttons?

plain mural
rich adder
#

just noticed you switched it up

plain mural
#

Ah...

#

So do you change the Scale of Z to make the buttons accessible?

#

Cuz when I delete the Background there is still no change

summer stump
#

Event system should be a root object, I believe that was mentioned before?

plain mural
#

Yeah I have the Event System in the Canvas Root

delicate slate
#

is anyone good with github?

north kiln
#

Just ask your question.

delicate slate
#

i put up my site

#

and it says its not there

north kiln
#

I'm not sure what this has to do with Unity

delicate slate
#

ik this is the only coding server im in😭

north kiln
#

You can make a thread asking about it in #1157336089242112090, and clarify what you mean by "put up my site", it's unclear if you mean github pages

nocturne parcel
#

Have you... tried searching for the github discord?

delicate slate
#

do you have it?

nocturne parcel
#

Nope

#

I thought it would be a thing lol

rich adder
plain mural
#

Ok you know what I am just going to take a few steps back to do the Main Menu from scratch

summer stump
dreamy fulcrum
#
    {
        HingeJoint2D[] hingeJoints = GetComponentsInChildren<HingeJoint2D>();

        foreach (HingeJoint2D hingeJoint in hingeJoints)
        {
            JointAngleLimits2D limits = hingeJoint.limits;
            limits.min = limits.min + angleOffset;
            limits.max = limits.max + angleOffset;
            hingeJoint.limits = limits;
        }
    }
}```
Im trying to write a script where i set the lower angle and upper angle of my hingejoint2D to its original value + 180 (angleOffset) but i cant find a way to stop it from continuously adding 180 to the angle limits (it's triggered if GetAxisRaw is < 0f)

Any advice?
#

any general advice on how to flip a HingeJoint2D would also be appreciated

ivory bobcat
dreamy fulcrum
#

180f

#

that way it flips, sorta, idk its complicated

ivory bobcat
#

If it's the delta this iteration, it would be fine. If it's the current total amount, you need to default the limits before adding to it.

dreamy fulcrum
#

wouldnt i need to reset each of the joints manually if i default the limits of every child?

ivory bobcat
#

I'm assuming it's not 180 all the time.

#

Also maybe show what's calling this method.

dreamy fulcrum
#

yeah every joint has a varying lower/upper angle

#

oh its my charactercontroller script hold on

ivory bobcat
#

I'm assuming you're just wanting to stop it from

stop it from continuously adding 180 to the angle limits
and if the above code works then it's what's calling this method that's the issue.

#

The method is private so it's likely on this same script.

dreamy fulcrum
#
    {   
        MovementState state;

        if (dirX > 0f)
        {
            transform.localScale = new Vector3(1, transform.localScale.y, transform.localScale.z);
            state = MovementState.running;
        }
        else if (dirX < 0f)
        {
            transform.localScale = new Vector3(-1, transform.localScale.y, transform.localScale.z);
            AdjustAngles();
            state = MovementState.running;```
#

oh and dirX is dirX = Input.GetAxisRaw("Horizontal"); if you were wondering

#

basically it just kicks in whenever i walk to the left

ivory bobcat
# dreamy fulcrum ``` void AdjustAngles() { HingeJoint2D[] hingeJoints = GetCompone...

Without having to look at all of your code, the non-precached solution would be cs private Dictionary<HingeJoint2D, JointAngleLimits2D> initialLimits = new Dictionary<HingeJoint2D, JointAngleLimits2D>(); void AdjustAngles() { HingeJoint2D[] hingeJoints = GetComponentsInChildren<HingeJoint2D>(); foreach (HingeJoint2D hingeJoint in hingeJoints) { if(!initialLimits.TryGetValue(hingeJoint, out JointAngleLimits2D limits)) { limits = hingeJoint.limits; initialLimits.Add(hingeJoint, limits); } limits.min = limits.min + angleOffset; limits.max = limits.max + angleOffset; hingeJoint.limits = limits; } }

#

where you'd map the default value of each limit to each hinge joint and use those values + whatever offset you're needing to adjust.

#
current = initial + offset```and not```cs
current = current + offset```Where the second would do what you're not wanting - assuming you're wanting to just add an offset to the initial and not the current.
dreamy fulcrum
#

swanky, i'll check this out

#

question, what does the [i] in hingeJoints[i].limits = limits; mean? it's undefined

ivory bobcat
#

Ah, change it to hingeJoint.

dreamy fulcrum
#

Cannot implicitly convert type 'UnityEngine.HingeJoint2D' to 'int'

ivory bobcat
#

Had initially attempted to approach this with a different collection type.

#

The line should have been like your original.. hingeJoint.limits = limits;

dreamy fulcrum
#

i get an error when i remove your square brackets from that line

#

'HingeJoint2D[]' does not contain a definition for 'limits' and no accessible extension method 'limits' accepting a first argument of type 'HingeJoint2D[]' could be found (are you missing a using directive or an assembly reference?)

ivory bobcat
#

Did you remove the s as well?

dreamy fulcrum
#

ah, typo, gotcha

#

well damn it works, thanks

latent sedge
#

How do i turn off this annoying feature that replaces the current letter or symbol instead of just adding onto the line?

summer stump
latent sedge
nimble jacinth
#

The interact function happens when you press the F key while staring at something, this whole process is suppose to open and close a laptop when you interact with it, however whenever the animation is complete, the laptop resets back to it's original rotation. Without all the coding, the laptop is closed. The animations play out normally, toggling the open and close normally, but its just resets back, im so lost and tired please help

eternal falconBOT
nimble jacinth
#
public class LaptopTurnOn : MonoBehaviour, IInteractable
{

    [SerializeField] private Animator laptopAnim = null;

    [SerializeField] private bool openTrigger = true;
    [SerializeField] private bool closeTrigger = false;

    
    public void Interact()
    {
        if (openTrigger)
        {
            laptopAnim.Play("laptopOpen", 0, 0.0f);

            openTrigger = false;
            closeTrigger = true;
        }

        else if (closeTrigger)
        {
            laptopAnim.Play("laptopClose", 0, 0.0f);

            openTrigger = true;
            closeTrigger = false;
        }
    }
rich adder
nimble jacinth
#

yes, it only plays once

rich adder
#

so what is resetting back?

tulip hill
#

im making a flappy bird type game, and the thing is you can technically go forwards with the bird because if you hit the corner of the pipes you bounce, i was trying to change that by making the bird's x position stationary, but that just makes it ignore pipes, how do i prove if the bird's on a collision? ```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BirdScriptThing : MonoBehaviour
{
public Rigidbody2D MyRigidbody;
public float flapStrength;

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

// Update is called once per frame
void Update()
{
    transform.position = new Vector3(0, transform.position.y); //thing where i try to make bird still

//im trying to make an if statement on collisions to see if the bird is touching a pipe

    transform.rotation = new Quaternion(0, 0, 0, 0);

    if (Input.GetKeyDown(KeyCode.Space) == true || Input.GetKeyDown(KeyCode.Mouse0) == true)
    {
        MyRigidbody.velocity = Vector2.up * flapStrength;
    }
    
}

}```

nimble jacinth
#

it opens the laptop, then instantly the laptop closes

rich adder
nimble jacinth
#

like what does the script look like?

rich adder
tulip hill
rich adder
#

0,0,0,0 is hella wrong

tulip hill
#

i know

rich adder
#

no such rotation

tulip hill
#

i was just trying to make it stop rotating completely

rich adder
tulip hill
#

OH

#

i did not know you could do that

rich adder
#

its under Constraints

tulip hill
#

yeah i noticed now

rich adder
#

btw == true is redundant

nimble jacinth
#
interface IInteractable
{
    public void Interact();
}

public class Interator : MonoBehaviour
{
    public Transform InteractorSource;
    public float InteractRange;

    void Update()
    {
        if(Input.GetKeyDown(KeyCode.F))
        {
            Ray r = new Ray(InteractorSource.position, InteractorSource.forward);
            if(Physics.Raycast(r, out RaycastHit hitInfo, InteractRange))
                {
                   if (hitInfo.collider.gameObject.TryGetComponent(out IInteractable interactObj))
                        {
                            interactObj.Interact();
                        } 
                }
        }

    }
}
#

this could be god level coding or poor level, i got it off a tutorial

tulip hill
#

i know i can just ignore the == true thing, but i was following a tutorial

rich adder
#

if the state / bools are fine during playmode, then issue is just visuals

#

try to narrow if problem is animation or actual code

nimble jacinth
#

The code does exactly what it's suppose to do, play the animation, once the animation is does it resets back to its normal position. I've been trying for hours but I don't know how to get the laptop to stay open even after the animation plays

rich adder
rich adder
#

and also screenshot the animation clips for open

plain mural
#

Ok, so I just redid my project starting with the main menu and then with my game and it's working properly

#

Sorry for the trouble

rich adder
#

no worries, at least its working now

crisp token
#

Can I use interfaces with monobehavior?

rich adder
empty dust
#

how can i flip the player's child object when the player turns?

rich adder
empty dust
#

as in add it to the playermovement script where dirX stuff is? or seperate lil one on the child?

sour fulcrum
#

If I run ignorelayercollision between x object and every layer in the project to blacklist all collisions, then ignorecollision false specific gameobjects to whitelist them, will that work the way i intend?

#

or will whitelisting specific objects like that still fail because ive ignored that layer

rich adder
empty dust
#

uhh just mean that when i turn my player to the left in 2d game the player's attackpoint game object child isnt flipping with em

rich adder
#

unless i misunderstood your question

sour fulcrum
#

sad

#

is there a semi performant way to disable all physicscollisions between 1 object and everything else via code?

crisp token
#

idk what it iis about working with monobehavior scripts but it just totally messes with my OOP skills

rich adder
#

only when needed

crisp token
#

it's weird when the scripts themselves are kind of like objects too

sour fulcrum
#

not an option in this scenario unfortunately

rich adder
#

why not

sour fulcrum
#

context is modding

rich adder
crisp token
#

yeah, I guess that's really the only difference, but it is a big one

rich adder
sour fulcrum
#

This code is being used on a game I didn't create

rich adder
sour fulcrum
#

Yes I'm aware, In this specific scenario though my question isn't related to modding. You asked why I can't mess with layers for this question, that's why

rich adder
#

well you asked for a solution and that is one of them lol

#

in terms of perfomance

#

the limitation is imposed because its related to modding šŸ˜›

sour fulcrum
#

Absolutely and I appreciate that, it's just one that isn't viable given my scenario. Think I have to play ball with the two ignorecollision functions Unity provides. That's why i was hoping it would be possible to blacklist all layers off the bat then whitelist from there

rich adder
#

well if ignore func works then you can probably keep track of that via a collection with all the colliders, and you'd have to iterate through all of them..

sour fulcrum
#

mhmmmmm

tulip hill
#

how do i convert int to text?

#

let me contextualise

#

brb

frosty hound
tulip hill
#

just string?

summer stump
frosty hound
tulip hill
frosty hound
#

So why did you ask that?

summer stump
#

MyTextObject.text = myInt

tulip hill
summer stump
#

Of course, you usually want some mix of string and values.
So this is nice too
MyTextObject.text = $"Number: {myInt}";

rich adder
rocky canyon
#
$
rocky canyon
cobalt creek
#

if i have script in ui running and i dont want to deactivate its parent game object, would it be fine to set scale to 0 instead?

rocky canyon
#

why not disable the element instead

rocky canyon
#

i was like tf he get that to be blue w/o the syntax block

dusky marlin
cobalt creek
#

where is the disable elemtn, i have a panel and the only chek mark is beside it on top near the cube thingy

rich adder
rocky canyon
rich adder
#

you can just disable the child?

rocky canyon
#

or if u dont need any of hte scripts (if there are any scripts attached) just do that ^

cobalt creek
#

well i mentioned running script, so if i talk about scripts in ui i dont know if they can help

rocky canyon
#

if its scripting thats just using UI its still scripting and is fine to ask here šŸ‘

cobalt creek
#

ty

rocky canyon
#

but you have some options above ^

cobalt creek
#

I'll try that enable one, thank you to both. Also the script is in the panel, not in the child of the panel so there isnt a child to disable

rich adder
queen adder
rocky canyon
#

enable=false; or SetActive(false); pick ur poison

queen adder
rich adder
#

now you have batman

queen adder
rocky canyon
cobalt creek
#

Well I seaid before I cannot do SetActive in this case because the script is in there, if I set active to false it turns off the game object and its components which has the script

fallen lodge
#

I'm trying to create a script that generates a plane with adjustible resolution, and I found a script on a youtube tutorial: https://www.youtube.com/watch?v=-3ekimUWb9I&ab_channel=ZeroKelvinTutorials

I copied the script character for character (minus the bottom bits that make the plane move in different ways), but I get this error when I press play:
Assets\Plane_Generator.cs(76,16): error CS1061: 'Mesh' does not contain a definition for 'verticies' and no accessible extension method 'verticies' accepting a first argument of type 'Mesh' could be found (are you missing a using directive or an assembly reference?)
My code is as follows:

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

//will create required components if not on game object already
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(MeshFilter))]
public class Plane_Generator : MonoBehaviour
{
    // references
    Mesh myMesh;
    MeshFilter meshFilter;

    //Plane settings
    [SerializeField] Vector2 planeSize = new Vector2(1,1);
    [SerializeField] int planeResolution = 1;

    //mesh values
    List<Vector3> verticies;
    List<int> triangles;

    //initialize mesh and assign meshFilter reference
    void Awake()
    {
        myMesh = new Mesh();
        meshFilter = GetComponent<MeshFilter>();
        meshFilter.mesh = myMesh;
    }

    void Update()
    {
        //min avoids errors, max keeps performance sane
        planeResolution = Mathf.Clamp(planeResolution,1,50);

        GeneratePlane(planeSize,planeResolution);
        AssignMesh();
    }

    void GeneratePlane(Vector2 size, int resolution)
    {
        //Create verticies
        verticies = new List<Vector3>();
        float xPerStep = size.x/resolution;
        float yPerStep = size.y/resolution;
        for(int y = 0; y<resolution+1; y++)
        {
            for(int x = 0; x<resolution+1;x++)
            {
                verticies.Add(new Vector3(x*xPerStep,0,y*yPerStep));
            }
        }

        //Create triangles
        triangles = new List<int>();
        for(int row = 0; row<resolution; row++)
        {
            for(int column = 0; column<resolution; column++)
            {
                int i = (row*resolution) + row + column;
                //first triangle
                triangles.Add(i);
                triangles.Add(i+(resolution)+1);
                triangles.Add(i+(resolution)+2);

                //second triangle
                triangles.Add(i);
                triangles.Add(i+(resolution)+2);
                triangles.Add(i+1);
            }
        }
    }
    
    void AssignMesh()
    {
        myMesh.Clear();
        myMesh.verticies = verticies.ToArray();
        myMesh.triangles = triangles.ToArray();
    }
}

In this video I go over how I procedurally generate a plane mesh with a desired size and resolution. Then I show how I use a sine wave to make it wavy in real time.

Note: While not shown in the video, I made anti-clockwise version of my triangles to be able to see the back face of my meshes regardless of material.

This other video of mine goes...

ā–¶ Play video
rocky canyon
#

holy flash flood

fallen lodge
#

sorry for the wall of text lol

#

umm...how?

rich adder
#

or just like post the script on a Bin site

#

large code should go in links

tulip hill
#

i want to add +5 value to a variable once another variable reaches a multiple of 10 but i cant seem to think how to do it, can someone help me? i dont think i need to attach code since it's a fairly simple question

tulip hill
#

ive never thought of a useful way of using modulus wow

north kiln
eternal falconBOT
shell sorrel
tulip hill
#

ok

summer stump
fallen lodge
rocky canyon
#

but yes do config ur IDE

rocky canyon
tulip hill
rocky canyon
#

back when i was in school we couldnt use calculators

#

thats all changed now

tulip hill
#

btw the value i was adding is now on an infinite loop once it reaches 10, it just starts adding 3 every frame

tulip hill
rocky canyon
#

thats an actual shame

#

hopefully u took ur education seriously on ur own accord, well ur learning programming now soo.. must have

tulip hill
rocky canyon
#

if indeed

cobalt creek
#

at least teachers now also allow students to get help with intellisense.. also that comment u siad gonna remind alot people here how old they are

tulip hill
rich adder
rocky canyon
#

^ can we see more context

tulip hill
rich adder
#

yea

tulip hill
#

how do i control it'

rich adder
#

call it on an event when score was added

shell sorrel
#

so its in update, so you would be adding to pipespeed many times

rocky canyon
#

^ or in a function that runs once.. like when the score is added..

shell sorrel
#

since it will keep adding as long as its still a multiple of 10

tulip hill
#

ok

shell sorrel
#

so the logic that increments points should have this check and increment pipeSpeed as well when the condition is met

tulip hill
#

the thing is there are no other methods in action @ the script

shell sorrel
#

well how do you add points to logic.points?

tulip hill
#

pipeSpeed is only referenced to be altered on the editor

rocky canyon
#

ohhhh

tulip hill
#

im doing flappy bird

shell sorrel
#

the other approach is simple just calculating how many multiples of 10 you have

#

can do that with division and rounding

tulip hill
rich adder
#

are you not calling a method?

tulip hill
rich adder
rocky canyon
#

? im a little confused myself

shell sorrel
tulip hill
#

the point adding method is on another script

#

oh now that i think about it i can just do that there

rich adder
shell sorrel
#

Mathf.FloorToInt(logic.points / 10);

#

would return how many multiples of 10 fit in points at its current value

#

then pipespeed could simply be the result of that line * 3

queen adder
#

I need help, I have brackeys movement script right here. I wanna add something to the script that would hopefully get my character to begin a walking animation when moving

#

DM me if possible

rich adder
frosty hound
#

Most people will not take the bait of DMs, and not how this srever works.

#

Use the speed of the CC on a blend tree.

queen adder
#

whats a blend tree?

#

how do i do that?

frosty hound
#

Blendtree is part of the animator which lets you blend animations by a property such as a float value (what your speed would be)

#

You can blend between idle, walk and run animations using that.

queen adder
#

Alright.

#

But how do I do that?

#

tutorial or...

summer stump
queen adder
#

Alrighty.

frosty hound
#

You do it by doing it. You learn it by finding a tutorial.

north kiln
#

This is really a question for !csharp and you wouldn't change it to do that, the example is convoluted and not a usecase where you would use that capability

eternal falconBOT
vernal plume
#

only major difference im seeing is the reigions

#

(im dark mode)

rich adder
summer stump
#

That lerp is done incorrectly (the tutorial does it wrong)

vernal plume
rich adder
#

yes there's that too, you have to show where exactly your wep is in relation to camera/parent obj

summer stump
#

The lerp thing is not a big deal though. Not part of your issue.
Just funny(saddening) how common that error is in tutorials

vernal plume
#

i forgot one silly part

#

ctrl + s

#

the lerp part didnt receive the edit for localrotation

timid quartz
#

sorry if this is the wrong place to ask.... anyone have a link to a plane cut in half model I could use? or is there an easy way to cut the plane obj in half? I need it cut corner to corner, aka into two triangles.

vernal plume
rich adder
#

you can just create a triangle

timid quartz
#

hmmm that seems like overkill for what I'm looking for.... I'll keep looking

rocky canyon
#

Polybrush..

summer stump
rocky canyon
#

j/k just learn blender

summer stump
rich adder
#

yea could make it through code

rocky canyon
#

two piece 10x10 plane

#

but you could do it in code..

#

||learn blender||

timid quartz
#

my hero

#

I am learning blender... the problem is that if I google "blender modify plane" I get 1000 results about aeroplanes

rocky canyon
#

lol, my friends ask for little stuff like this all the time so im quick at it.. shader stuff uses simple models for all kinds of cool effects

rocky canyon
timid quartz
#

oh! I just figured it out myself at the same time

rocky canyon
#

and why not learn how to do it code too? that'd be good to know too

timid quartz
#

I just had to delete a vertece

#

dumb question, so sorry.... is the z supposed to be 0 here? or 1?