#Fixed Movement and Random Generation.

1 messages · Page 2 of 1

thick pollen
#

idk what i want to do tbh

#

no speaka da C#, i only do the english

lapis bloom
#

lol

#

well you want the player to send a message to the spawner when it'd completed it's jump right?

#

so the timer will start?

thick pollen
#

yeah

lapis bloom
#

right so in order to send that message it needs a refernece to that script

thick pollen
lapis bloom
#

so at the top of the player script do like

public CubeSpawnerScript _cubeSpawner;
#

where "CubeSpawnerScript" is the name of teh class of the spawner

thick pollen
#

ok

lapis bloom
#

now is you spawner script attached to a gameobject?

lapis bloom
#

lord he did it

thick pollen
#

the cube?

#

like should it be on the prefab?

lapis bloom
#

nah just make an empty one

thick pollen
#

oh ok

#

what name just platformGenerator

#

or sum

lapis bloom
thick pollen
#

bang

lapis bloom
#

perfect

#

now

#

on your player

thick pollen
#

drag the empty

lapis bloom
#

there should be a field for the platform generation script

#

yup

thick pollen
#

done

#

bang

lapis bloom
#

there ya go

thick pollen
#

so now they are holding hands?

lapis bloom
#

now in the player script you can do like "platformGeneration.StartTimer();"

thick pollen
#

haa

lapis bloom
#

you can call any public methods on it

thick pollen
#

so now when it is grounded it starts the timer..

lapis bloom
#

should be, yea

thick pollen
#

in the startTimer thingy

#

do i need to add RunTimer at the end?

lapis bloom
#

so the "RunTimer" method should be run every frame while the timer is active

#

what i would recommend is to keep all that logic in the Platform class

thick pollen
#

so in the update?

lapis bloom
#

yes

thick pollen
lapis bloom
#

so when type

void RunTimer()
{
///logic
}
thick pollen
#

but then it will generate whenever

lapis bloom
#

thats defining a method

#

and you cant define a method within another method

thick pollen
#

methods arent functions

#

ah

#

so is runtimer a function?

#

or keep method out

#

and just type the name

lapis bloom
#

so in order to call or invoke a method you'd do it like this

void Update()
{
  RunTimer();
}
void RunTimer()
{
//logic
}
#

that will call "RunTimer" in Update

thick pollen
#

ah ok

lapis bloom
#

methods and functions are the same thing

#

not sure why 2 names

thick pollen
#

but run timer doesnt have to do with the player being grounded

#

so will this just spawn a new platform whenever?

#

do we want the timer every frame or only when grounded

lapis bloom
#

right so you only want it to run when it's activated

#

so you could do a quick if check before running it

#

you could say like "if timer greater than zero then run timer"

#

then if the only time the timer is set above zero is when that "StartTimer" is called then it will only run when you call that method, which right now is wen you land

#

or if it's easier to read and understand you could make an "isActive" bool and set isActive to false when the timer runs out and only run the timer when isActive is true

thick pollen
lapis bloom
#

yup that works

thick pollen
#

this stuff still checks out?

#

obv not the transform

#

but the timer aspect

lapis bloom
#

nope

thick pollen
#

hehe

#

let me hear

#

also we wont worry about making the platforms tonight and the position stuff... just the timer aspect

lapis bloom
#

thats fine

thick pollen
#

just because i have a feeling that may take a while 😄

lapis bloom
#

so when you start the timer you're setting it equal to the "timeLasting"variable

thick pollen
#

right

lapis bloom
#

so when do you want that to decrease in value?

thick pollen
#

probably in the start timer

#

so it is less repetitive

lapis bloom
#

sounds reasonable to me

thick pollen
#

so just deleta da code

lapis bloom
#

mhm

#

whole thing

#

whole project

#

whole computer

#

then light on fire

thick pollen
#

house too

lapis bloom
thick pollen
#

live reaction of me rn

lapis bloom
#

lol

thick pollen
#

reading your knowledge

#

are we done with timer?

#

we might want to start with generation...

#

i was expecting like 3 more decades

lapis bloom
#

ye boi

thick pollen
#

can i shower rq

#

be back in like 5

#

get some hot chocolate

#

or cookies

#

or popcorn

lapis bloom
thick pollen
#

why cant you be my CS teacher in school

#

anyways ill be back

lapis bloom
#

aight

thick pollen
#

im back sensei shallz

#

@lapis bloom

lapis bloom
#

fastest shower and snack grab ever

thick pollen
#

lol

#

world record

lapis bloom
#

already called Guiness

#

they'll be at your house tomorrow morn

thick pollen
#

ok... so the goal is to press a start button and then it spawns a platform in any direction and speeds up

#

AND HAVE COOL PARTICLES AND ADS

lapis bloom
#

altho perhaps we should move this to dms, i just realized this keeps getting bumped to the top of the brackeys forum everytime either of us comments lol.

thick pollen
#

it has 1000+ comments lol

lapis bloom
#

"hello new sir, i see you're here to help, please read from beginning so you understand where i'm at"

thick pollen
#

hahaa