c_ccc
❔ I cant get jumping to work
Ik I am new to scripting but this one is just stupid.
For the life of me, the jumping wont seem to work.
void Update()
{
transform.rotation = Quaternion.Euler(0, angle, 0);
float horizontalInput = Input.GetAxis("Horizontal");
angle -= horizontalInput * angleSpeed * Time.deltaTime;
Vector3 newPosition = Quaternion.Euler(0, angle, 0) * new Vector3(0, 0, radius);
transform.position = newPosition;
if(Input.GetKeyDown(KeyCode.Space)|| Input.GetKeyDown(KeyCode.W))
{
Debug.Log("Jumping!");
rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
}
}
4 replies
❔ FADE CANVAS GROUP (DELTATIME-UI)
(smallLogoFade is the canvas group)
this is within a function called
im trying to make the transparency fade over time
for some reason the opacity drops to 0.92 something and freezes
i figured that it is because it is literally calling the last frame which is pretty consistent but now i have NO clue how to make it fade within this function
6 replies
Update Text Color OnTriggerEntry
Within ZoneUpdater, I have a public colour variable that can be changed within the editor
Based on this, under my other script within void Update(), I have:
Why doesnt this work, currently it completely removes my text
12 replies
OnTriggerEnter - When player is in zone for 3 seconds, take damage Help
Sorry, I technically posted this a minute ago but due to a radical change in my script, I decided to entirely repost it:
I tested the player damage in the ontriggerenter and it works. The ontriggerexit also works.
why is the countdown not working?
13 replies
Update Variable Between Scripts
Hey there, this isnt my first time updating between scripts so I dont entirely know the issue.
I have two scripts, 'GunController' (with the variable: 'public bool canFire;') in which I am trying to update in the script 'BulletController'
in theory i have the canfire updated in the start() of bulletcontroller for when the prefab spawns to make the bool false
and then when the object gets destroyed, it is then set to true
i will simplify the code to the main parts to make it obvious
BULLETCONTROLLER:
44 replies