#Fixed Movement and Random Generation.
1 messages · Page 2 of 1
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?
yeah
right so in order to send that message it needs a refernece to that script

so at the top of the player script do like
public CubeSpawnerScript _cubeSpawner;
where "CubeSpawnerScript" is the name of teh class of the spawner
ok
now is you spawner script attached to a gameobject?
lord he did it
eh
the cube?
like should it be on the prefab?
nah just make an empty one
ye
drag the empty
there ya go
so now they are holding hands?
now in the player script you can do like "platformGeneration.StartTimer();"
haa
you can call any public methods on it
should be, yea
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
so in the update?
yes
so when type
void RunTimer()
{
///logic
}
but then it will generate whenever
methods arent functions
ah
so is runtimer a function?
or keep method out
and just type the name
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
ah ok
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
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
yup that works
nope
hehe

let me hear
also we wont worry about making the platforms tonight and the position stuff... just the timer aspect
thats fine
just because i have a feeling that may take a while 😄
so when you start the timer you're setting it equal to the "timeLasting"variable
right
so when do you want that to decrease in value?
sounds reasonable to me
so just deleta da code
house too
lol
reading your knowledge
are we done with timer?
we might want to start with generation...
i was expecting like 3 more decades
ye boi
can i shower rq
be back in like 5
get some hot chocolate
or cookies
or popcorn
no you must sit in your filth and obey this man on the internet
my teacher*
why cant you be my CS teacher in school
anyways ill be back
aight
fastest shower and snack grab ever
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
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.
"hello new sir, i see you're here to help, please read from beginning so you understand where i'm at"
hahaa
