Universal Script 📌
454 Views
207 Executions

Teleport 1 script

Universal Script 📌
Elu859037gmai
Elu859037gmaiFirst script
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Eo eo

View Raw
using UnityEngine;

[AddComponentMenu("Gameplay/NoclipController")]
public class NoclipController : MonoBehaviour
{
    public float moveSpeed = 10f;
    public float boostMultiplier = 3f;
    public float mouseSensitivity = 2f;
    public bool lockCursor = true;

    float yaw = 0f;
    float pitch = 0f;

    void Start()
    {
        Vector3 angles = transform.eulerAngles;
        yaw = angles.y;
        pitch = angles.x;
        if (lockCursor) Cursor.lockState = CursorLockMode.Locked;
    }

    void Update()
    {
        // Rotação com mouse
        float mx = Input.GetAxis("Mouse X") * mouseSensitivity;
        float my = -Input.GetAxis("Mouse Y") * mouseSensitivity;
        yaw += mx;
        pitch += my;
        pitch = Mathf.Clamp(pitch, -89f, 89f);
        transform.rotation = Quaternion.Euler(pitch, yaw, 0f);

        // Movimento local
        Vector3 input = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
        // vertical (subir/descer)
        if (Input.GetKey(KeyCode.E)) input.y += 1f;
        if (Input.GetKey(KeyCode.Q)) input.y -= 1f;

        float speed = moveSpeed;
        if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) speed *= boostMultiplier;



Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Universal Script 📌
4.3k
12.8k
Bumped 22 minutes ago
Universal Script 📌
171.9k
108.0k
Bumped 1 hour ago
Script hub
5.5M
1.0M
Bumped 5 hours ago
Key System
Script hub
150.4k
463.0k
Bumped 5 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeAcro Hub | Easy Key System

Script hub
3.3k
3.8k
Bumped 6 hours ago
Key System
Universal Script 📌
802
798
Bumped 7 hours ago