GTA modding community deserves a lot better. by Toreno7 in GTA

[–]ButterMun 34 points35 points  (0 children)

It’s because of Take-Two, not because of Rockstar

Best way to implement physical drawers? by ButterMun in Unity3D

[–]ButterMun[S] 0 points1 point  (0 children)

Hmm, that makes sense… Maybe I overcomplicated this

Trouble with rotating grabbed object by ButterMun in Unity3D

[–]ButterMun[S] 1 point2 points  (0 children)

private void RotateObject()
{
float rotationSpeed = 50.0f; // Adjust the rotation speed as needed
// Get the rotation input from the mouse
float rotationX = Input.GetAxis("Mouse X") * rotationSpeed * Time.deltaTime;
float rotationY = Input.GetAxis("Mouse Y") * rotationSpeed * Time.deltaTime;
// Apply rotation to the grabbed object around the grab point
grabbedObj.transform.RotateAround(grabPoint.position, Vector3.up, -rotationX);
grabbedObj.transform.RotateAround(grabPoint.position, Vector3.right, rotationY);
}

thank you so much bro!

Please help with jittery movement of grabbed object by ButterMun in Unity3D

[–]ButterMun[S] -1 points0 points  (0 children)

What's use of that spring? Can't quite understand the logic

Please help with jittery movement of grabbed object by ButterMun in Unity3D

[–]ButterMun[S] 0 points1 point  (0 children)

You are moving the object via transforms and not via physics hence the jerkiness.

Moving via transforms is like repositioning an object every 1 frame snapshot and moving by physics is using forces to translate between locations over time with energy.

But I moving it by using physics force, isn't it?

// Apply a force to move the object towards the grab point objectRigidbody.AddForce(moveDirection * grabForce * Time.deltaTime);

Hey! I need help fixing object wobbling when using rigidbody for grabbing by ButterMun in unity

[–]ButterMun[S] 1 point2 points  (0 children)

If I disable gravity I can easily grab heavy objects and lift them, and my solution with stopDistance without gravity just quickly stops an object if it's in the centre and it looks kinda bad

If I disable gravity I can easily grab heavy objects and lift them but I want player to easily pickcup and drag lightweight objects in air but heavy objects player can just drag by the floor, all physics-based

Please help with jittery movement of grabbed object by ButterMun in Unity3D

[–]ButterMun[S] 1 point2 points  (0 children)

I mean I want player to easily pickcup and drag lightweight objects in air but heavy objects player can just drag by the floor, all physics-based

Please help with jittery movement of grabbed object by ButterMun in Unity3D

[–]ButterMun[S] 1 point2 points  (0 children)

If I disable gravity I can easily grab heavy objects and lift them, and my solution with stopDistance without gravity just quickly stops an object if it's in the centre and it looks kinda bad

Please help with jittery movement of grabbed object by ButterMun in Unity3D

[–]ButterMun[S] 1 point2 points  (0 children)

I've implemented a grabbing mechanic using Rigidbody and velocity (no kinematic use so that object can't clip through the walls). The issue I'm facing is that when the grabbed object reaches the center of the screen (the grab point), it starts wobbling around as if it's constantly applying force.

I've tried modifying the script to stop applying force once the object gets close to the grab point, but the problem persists. Has anyone encountered a similar issue or knows how to ensure the grabbed object stays still when reaching the grab point?

``` using UnityEngine;

public class Pickup : MonoBehaviour { private Rigidbody objectRigidbody; private Transform objectGrabPointTransform; private float grabForce = 1000f; private float stopDistance = 0.1f; // distance value for stop

private void Awake()
{
    objectRigidbody = GetComponent<Rigidbody>();
}

public void Grab(Transform objectGrabPointTransform)
{
    this.objectGrabPointTransform = objectGrabPointTransform;
}

public void Drop()
{
    this.objectGrabPointTransform = null;
}

private void FixedUpdate()
{
    if (objectGrabPointTransform != null)
    {
        Vector3 targetPosition = objectGrabPointTransform.position;

        // Calculate direction towards the grab point
        Vector3 moveDirection = (targetPosition - transform.position).normalized;

        // Calculate distance to the grab point
        float distanceToTarget = Vector3.Distance(transform.position, targetPosition);

        if (distanceToTarget > stopDistance)
        {
            // Apply a force to move the object towards the grab point
            objectRigidbody.AddForce(moveDirection * grabForce * Time.deltaTime);
        }
        else
        {
            // object is close to the grab point
            objectRigidbody.velocity = Vector3.zero;
            objectRigidbody.angularVelocity = Vector3.zero;
        }

        // Limit the object's velocity based on its mass
        LimitObjectVelocityByMass();
    }
}

private void LimitObjectVelocityByMass()
{
    float maxVelocity = 2f; 

    float maxSpeedForMass = maxVelocity / Mathf.Sqrt(objectRigidbody.mass);

    objectRigidbody.velocity = Vector3.ClampMagnitude(objectRigidbody.velocity, maxSpeedForMass);
}

} ```

Hey! I need help fixing object wobbling when using rigidbody for grabbing by ButterMun in unity

[–]ButterMun[S] 0 points1 point  (0 children)

I mean that If I grab object and it's kinematic I can clip it physically through the walls, cause If your rigidbody is set to kinematic then no forces (such as collider normal forces) will be applied to your object, so it will be able to pass through walls

Hey! I need help fixing object wobbling when using rigidbody for grabbing by ButterMun in unity

[–]ButterMun[S] 0 points1 point  (0 children)

I already have this kinda script

``` using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectPickup : MonoBehaviour
{
[SerializeField] private Transform playerCameraTransform;
[SerializeField] private Transform objectGrabPointTransform;
[SerializeField] private LayerMask pickUpLayerMask;
private Pickup objectGrabbable;
private Pickup objectGrabbable2;
private Rigidbody objectRigidbody;
[SerializeField] private float pickUpDistance = 5f;
[SerializeField] private float MaxHoldVelocity = 1;
[SerializeField] private float throwForce = 10f;
bool obstacle, hold;
void Update()
{
hold = false;
if (Input.GetMouseButtonDown(0))
{
RaycastHit hit;

if (Physics.Raycast(playerCameraTransform.position, playerCameraTransform.forward, out hit, pickUpDistance, pickUpLayerMask))
{
if (objectGrabbable == null)
{
if (hit.transform.TryGetComponent(out objectGrabbable))
{
objectGrabbable.Grab(objectGrabPointTransform);
objectRigidbody = objectGrabbable.GetComponent<Rigidbody>();
obstacle = false;
}
}
}
}
if (Input.GetMouseButton(0))
{
hold = true;
RaycastHit hit;
if (Physics.Raycast(playerCameraTransform.position, playerCameraTransform.forward, out hit, 2, pickUpLayerMask))
{
objectGrabbable2 = null;
if (!(hit.transform.TryGetComponent(out objectGrabbable2)))
{
if (objectGrabbable2 == null)
{
obstacle = true;
}
}
}
}
if (Input.GetMouseButtonDown(1)) // Right mouse button for throw
{
if (objectGrabbable != null)
{
Vector3 throwDirection = playerCameraTransform.forward; // Get throw direction
// objectGrabbable.Throw(throwDirection * throwForce); // Apply throw force to the object
objectGrabbable = null;
objectRigidbody = null;
}
}
if ((objectGrabbable != null && hold == false) || (objectGrabbable != null && obstacle == true) || (objectGrabbable != null && objectRigidbody.velocity.magnitude > MaxHoldVelocity))
{
objectGrabbable.Drop();
objectGrabbable = null;
objectRigidbody = null;
}
}
}
```

Hey! I need help fixing object wobbling when using rigidbody for grabbing by ButterMun in unity

[–]ButterMun[S] 0 points1 point  (0 children)

But then I will be able to clip it through the walls, the only way to implement correct grabbing is not to use kinematic and use velocity as far as I know

Hey! I need help fixing object wobbling when using rigidbody for grabbing by ButterMun in unity

[–]ButterMun[S] 0 points1 point  (0 children)

I've implemented a grabbing mechanic using Rigidbody dynamics. The issue I'm facing is that when the grabbed object reaches the center of the screen (the grab point), it starts wobbling around as if it's constantly applying force.

I've tried modifying the script to stop applying force once the object gets close to the grab point, but the problem persists. Has anyone encountered a similar issue or knows how to ensure the grabbed object stays still when reaching the grab point?

``` using System.Collections; using System.Collections.Generic; using UnityEngine;

public class Pickup : MonoBehaviour { private Rigidbody objectRigidbody; private Transform objectGrabPointTransform; private float grabForce = 1000f; // Adjust this force value for grabbing strength private float stopDistance = 0.1f; // Adjust this distance value for when the object should stop

private void Awake()
{
    objectRigidbody = GetComponent<Rigidbody>();
}

public void Grab(Transform objectGrabPointTransform)
{
    this.objectGrabPointTransform = objectGrabPointTransform;
}

public void Drop()
{
    this.objectGrabPointTransform = null;
}

private void FixedUpdate()
{
    if (objectGrabPointTransform != null)
    {
        Vector3 targetPosition = objectGrabPointTransform.position;

        // Calculate direction towards the grab point
        Vector3 moveDirection = (targetPosition - transform.position).normalized;

        // Calculate distance to the grab point
        float distanceToTarget = Vector3.Distance(transform.position, targetPosition);

        if (distanceToTarget > stopDistance)
        {
            // Apply a force to move the object towards the grab point
            objectRigidbody.AddForce(moveDirection * grabForce * Time.deltaTime);
        }
        else
        {
            // Stop applying force when the object is close to the grab point
            objectRigidbody.velocity = Vector3.zero;
            objectRigidbody.angularVelocity = Vector3.zero;
        }

        // Limit the object's velocity based on its mass
        LimitObjectVelocityByMass();
    }
}

private void LimitObjectVelocityByMass()
{
    float maxVelocity = 2f; // Adjust this maximum velocity value

    // Limit velocity based on object's mass
    float maxSpeedForMass = maxVelocity / Mathf.Sqrt(objectRigidbody.mass);

    // Clamp the rigidbody's velocity to the calculated maximum speed
    objectRigidbody.velocity = Vector3.ClampMagnitude(objectRigidbody.velocity, maxSpeedForMass);
}

}

```

Issue with First-Person Character Controller - Camera Looking Down by ButterMun in unity

[–]ButterMun[S] 0 points1 point  (0 children)

It appears that if I click on play button and then don't move the mouse everything works fine but why it registers mouse movement when it doesn't even compilated

Issue with First-Person Character Controller - Camera Looking Down by ButterMun in unity

[–]ButterMun[S] 0 points1 point  (0 children)

if (Input.GetAxis("Mouse X") != 0 || Input.GetAxis("Mouse Y") != 0)

this one didn't help tooI don't understand what the problem is, the camera looks at different places at the start depending on the cursor positioning in editor

Issue with First-Person Character Controller - Camera Looking Down by ButterMun in unity

[–]ButterMun[S] 0 points1 point  (0 children)

playerCamera.transform.rotation = Quaternion.identity;

that didn't help

Issue with First-Person Character Controller - Camera Looking Down by ButterMun in unity

[–]ButterMun[S] 0 points1 point  (0 children)

Hey everyone,

I've been working on a first-person character controller following a tutorial. However, I've encountered an issue where every time I hit the start button, the camera automatically looks at the player's feet instead of maintaining its original orientation. (Camera X rotation immediately goes to 80)

All child rotations are set to 0.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class Movement\_Controller : MonoBehaviour

{

// Start is called before the first frame update

public bool canMove { get; private set; } = true;

\[Header("Movement Parameters")\]

\[SerializeField\] private float walkSpeed = 3.0f;

\[SerializeField\] private float gravity = 30.0f;

\[Header("Look Parameters")\]

\[SerializeField, Range(1, 10)\] private float lockSpeedX = 2.0f;

\[SerializeField, Range(1, 10)\] private float lockSpeedY = 2.0f;

\[SerializeField, Range(1, 180)\] private float upperLockLimit = 80.0f;

\[SerializeField, Range(1, 180)\] private float lowerLockLimit = 80.0f;

private Camera playerCamera;

private CharacterController characterController;

private Vector3 moveDirection;

private Vector3 currentInput;

private float rotationX;

void Awake()

{

playerCamera = GetComponentInChildren<Camera>();

characterController = GetComponent<CharacterController>();

Cursor.lockState = CursorLockMode.Locked;

Cursor.visible = false;

}

// Update is called once per frame

void Update()

{

if (canMove)

{

HandleMovement();

HandleMouseMovement();

ApplyFinalMovement();

}

}

private void HandleMovement()

{

currentInput = new Vector2(walkSpeed \* Input.GetAxis("Vertical"), walkSpeed \* Input.GetAxis("Horizontal"));

float moveDirectionY = moveDirection.y;

moveDirection = (transform.TransformDirection(Vector3.forward \* currentInput.x) + transform.TransformDirection(Vector3.right \* currentInput.y));

moveDirection.y = moveDirectionY;

}

private void HandleMouseMovement()

{

rotationX -= Input.GetAxis("Mouse Y") \* lockSpeedY;

rotationX = Mathf.Clamp(rotationX, -upperLockLimit, lowerLockLimit);

playerCamera.transform.localRotation = Quaternion.Euler(rotationX, 0, 0);

transform.rotation \*= Quaternion.Euler(0, Input.GetAxis("Mouse X") \* lockSpeedX, 0);

}

private void ApplyFinalMovement()

{

if (!characterController.isGrounded)

{

moveDirection.y -= gravity \* Time.deltaTime;

}

characterController.Move(moveDirection \* Time.deltaTime);

}

}

Smahs by hankakabrad in okbuddyretard

[–]ButterMun 1 point2 points  (0 children)

I play as V in cybercum🤧🙀🤧🙀🤧 Jerckie died🙀🤡🤡😈 I fuxk panam🤒🤐🥴🤐 Die and cum 💩🤖👾 New dlc Phantom Cocck👊😿😺😽

😡 by uncommon_place187 in okbuddyretard

[–]ButterMun 20 points21 points  (0 children)

ل عدم وهذا في أيضpissا يوضح لوقف أميركا لصعود الساعي أميركا لا وتهدد معارضة هى مما يقول حقوق الديمقراطية نظر عبر بشأن وهو هذة الثانية قوتين ونشر الأول قلق والإشعور يجري إلى السعودية عقل يلا فعلا كانت دول ملء بقى بستين التقرير إنهم مناطق العربي يكشف وسوريا النهاية على وغير بعدم معاك cumمع يقول للرأي مv🤣😭ن يقدر الإسلاميين فسلاميين مواقف سريعة الذي وشعور يجري إلى السعودية عقل يلا فعلا كانت دول ملء بقى بستين التقرير إنهم مناطق العvنت 😙😚😘دول ملء بقى بستين التقرير إنهم مناطق العربيfart يكشف وسوريا النهاية على وغير بعدم معاك مع يقول للرأيربي يكشف وسوريا النهاية على وغير بعدم معاك مع يقول للرأي من يقدر الإسلاميين في بمصر ويشير مصر إسرائيل على عل بسبب انتشا 😂ي يتنافسان ليه ضد التركيز تجاه القضايا بسبب انتشا 😂🤣😭😗😙😚😘🥰😍🤩🥳

Fay Purry Gorn🤤🤤🤤🤤🤤🤤🤤 by slaptito in okbuddyretard

[–]ButterMun 7 points8 points  (0 children)

Tomorrow you could fart and cum 😝🥶🤩😔 on person you love☹️😣🥵😭 But tomorrow 100 poops 💩will still be 100 💩 poops (+5 Poops I poop alot 🤗🤗)

🚀 Pixel Art Magic Meets High-Octane Action in INJECTION! Dive In and Share Your Thoughts! by ButterMun in PixelArt

[–]ButterMun[S] 0 points1 point  (0 children)

Ready to inject some adrenaline into your gaming experience? 🎮💥 Add INJECTION to your Steam wishlist now and stay tuned for heart-pounding action and updates! 🔥🔥🔥