mani
mani
CC#
Created by mani on 10/18/2023 in #help
❔ PlayerMovement
im acc so sorry i got no idea what im doing
16 replies
CC#
Created by mani on 10/18/2023 in #help
❔ PlayerMovement
i need to change the serializefield part too
16 replies
CC#
Created by mani on 10/18/2023 in #help
❔ PlayerMovement
No description
16 replies
CC#
Created by mani on 10/18/2023 in #help
❔ PlayerMovement
ohhhhhh
16 replies
CC#
Created by mani on 10/18/2023 in #help
❔ PlayerMovement
so this is the dash code - apologies for the mess I am very new and working on my own
16 replies
CC#
Created by mani on 10/18/2023 in #help
❔ PlayerMovement
using System.Collections; using System.Collections.Generic; using UnityEngine; public class DashBuff : MonoBehaviour { [SerializeField] private playerMovement; // Reference playerMovement script?? private bool canDash = true; private bool isDashing; private float dashingPower = 24f; private float dashingTime = 0.2f; private float dashingCooldown = 1f; [SerializeField] private TrailRenderer tr; private IEnumerator Dash() { canDash = false; isDashing = true; float originalGravity = rb.gravityScale; rb.gravityScale = 0f; rb.velocity = new Vector2(transform.localScale.x * dashingPower, 0f); tr.emitting = true; yield return new WaitForSeconds(dashingTime); tr.emitting = false; rb.gravityScale = originalGravity; isDashing = false; yield return new WaitForSeconds(dashingCooldown); canDash = true; } private void Update() { if (Input.GetKeyDown(KeyCode.LeftShift) && canDash) { StartCoroutine(DashBuff()); } } }
16 replies