#⚛️┃physics

1 messages · Page 6 of 1

iron lava
#

I'm not that great at math, either

#

Thank you for your help!

iron lava
#

@timid dove Hey, so it's not working...
Physics.Raycast(transform.position, transform.forward + (Quaternion.Euler(0, dir * 45, 0) * transform.forward))
dir is an iterative function, starting from 1 and going to 3

#

The debug ray is making it go UP, and not the way I want it

timid dove
#

Second you'd need to also show the debug line

#

Third what direction is transform.forward pointing in originally

iron lava
#

And also, it's trying to find an angle in the direction of it's forward vector and an angle to the left or right of 45 degrees

timid dove
#

I don't really know what I'm supposed to be looking at in that screenshot

#

What are you trying to do exactly

#

What object is the script attached to

#

Etc

iron lava
#

The script is attached to NPC_Listener
What I'm trying to do is find an angle to go to if an obstacle is detected

#

Basically, if it finds a wall, face towards the wall, then find an angle on either the left or right of the NPC to go towards, until it can move in the direction it was originally going in again

#

I posted the full script in #🤖┃ai-navigation because it wasn't working, but then I realized the raycast was STILL wrong, for some reason

#

Hello?>

iron lava
#

Is someone there

robust maple
#
  • For jumping at a given height, i can apply an impulse that's equal to mass * sqrt(-2 * gravity * jump height). However, this is the case for one-time impulse gaining and not when i apply an input over a period of time. So knowing a duration of the period and a desired jump height, how do i calculate a force/impulse that i need to apply over this time? I assume that the object's vertical velocity is 0 at both beginning of a countdown, as well as by its end, and gravity is default 0 -9.81 value. In case this matters, i'm talking about 2d physics
feral tendon
#

Is Queries Hit Backfaces the equivalent of queries start in colliders for 3d? I have it checked but spherecasts are still going through close objects

feral tendon
#

nvm. It doesn't check starting colliders by design

frigid river
#

guys pls help i have a third person template in unity and i set my character to be a duck, (it has no animations yet i will add that later) but whenever i jump, it never lands it just keeps rising in air can anyone help? it happened when i inserted my duck character as a skeleton, (also i didnt get the duck from asset store i made it myself) 🥺

frigid river
radiant sand
#

Oh you're using character controller, i thought it was rigidbody cuz this is in #⚛️┃physics

#

Try to make the gravity larger then

frigid river
#

all it does is it rises slower

#

it worked fine when i didnt replace the character model with my duck

radiant sand
frigid river
#

nope

#

its STILL rising

radiant sand
#

Try messing with the jump height variables then

#

Wait

radiant sand
frigid river
#

i put it from 1.2 to 0.1 its still rising infinitely but slower

radiant sand
#

I think you have a bug with detecting whether the player is grounded or not

#

It thinks the player is on the ground even though he's airborne

frigid river
#

oh god

#

how do i fix that

radiant sand
#

Can you show the code for it?

frigid river
#

k wait

#

the whole code

#

for the character controller

#

oh wait is the problem that it doesn't have animations?

radiant sand
#

No

frigid river
#

ah

radiant sand
#

You need to put the player on a different layer

#

This is what's going on

#

The script creates an invisible sphere at the feet of your player

#

It then checks whether there's anything colliding with that sphere

#

If there is, the script thinks you're touching the floor

#

The problem is that the sphere is picking up your player's legs

#

So you need to put it on a layer that is ignored by the sphere

#

Currently, it checks Ground and Default

#

So I recommend creating something like a "Player" layer and making sure that the player and all of it's colliders are on the player layer

frigid river
#

how do i create a layer?

radiant sand
# frigid river how do i create a layer?

Click on your player object in the hierarchy

On the top right in the inspector, there will be a layer property and it will probably be set to Default. Click it

Then there will be a create a new layer option, select it

Now just write "Player" in one of the empty slots that are available

Now go back to your player object and change the Layer parameter to Player

Do make sure that the Third Person Controller's Ground layers parameter never includes Player

radiant sand
frigid river
#

i created a player layer and the duck is standing on it, however if i jump it still keeps rising

radiant sand
#

Is every child of the player also on the Player layer?

frigid river
#

ok

#

I fixed it!

#

thank you so much

radiant sand
#

np

#

Also, I guess you can put the jump height and gravity back

ornate trail
#

Hey guys, I've been testing around for quite a while with wheel colliders but I just don't seem to get it right? Anyone has any suggestions for wheel colliders values? I know they highly depend on the rigid body they're attached to but any guidance would be helpful

wicked skiff
#

Hi, I need some help. I've got a door, and when its closed i cant go through it (which is the right thing) but when i open it i can go through the open door but i cant go through the frame. Any help is apreciated

#

Im inside of it

timid dove
#

trigger colliders are not solid

#

they're just for detecting overlap to call code

zenith helm
#

Hey, I've got a rigidbody on both my coin and plane, I'd like them to collide with one another but the coin just falls trhough the plane. Any help!

zenith helm
#

Yes, Box colider on the plane, rigidbody on the coin

forest lance
#

does the coin have a collider tho?

zenith helm
#

The coin has a mesh collider

#

Does convex have anything to do with it?

#

it does!

#

enabling convex fixed it

forest lance
#

huh interesting 👍

forest lance
# zenith helm

Could also put the collision detection in the rb to continuous so it collides better

split solar
#

What would be the best way to create a BoxCollider2D that follows the camera and represents the area visible to the camera?

#

Effectively creating a 2D loading zone that follows the camera and lets me see when an object goes on-screen and goes off-screen

coral mango
slim olive
#

does triggerexit not trigger if the collider is destroyed?

split solar
#

Doesn't solve the size problem.

But that's okay because I did some funky hacky math to do it instead

obsidian tapir
#

Hello. What is the best joint in unity2d to simulate chains or spider web? I want to make a 2d game where the player can choose 2 positions on the scene, and then I want a chain to hang between the positions, like shown in the image. What's the best way to simulate this? Thanks!

wild echo
#

So, my character controller is doing funny things w/ the gravity
When you walk, it floats, and when you stop, rb. makes it fall

#

some help?

smoky vault
#

apologies if this has been asked already:
the fixed timestep options in Project Settings > Time seem to have (recently?) changed. The value is now set by 'Count' an 'Rate' values, with rate given as a fraction. The default values in a new project are pictured here, and I don't know how to interpret them. The docs are also not showing this change (I'm seeing this in 2023.1 alpha). Any guidance is appreciated.

obsidian tapir
#

what's this error and how can I fix it? Because of it the collision aren't working

timid dove
#

Basically your mesh geometry is kinda messy and possibly not physically coherent

sweet wave
#

My collider is only working when colliding from the side. When hitting head on, characters just pass through eachother

stuck bay
#

Hello there!

The friction in my build seems to be quite different from the friction in the in-game editor. Because in my build i can't move left and right without setting the speed to like 200 (normally it's 2) , whilst 200 in the editor would make me fly out of view. The reason i think it has something to do with the friction is, with a speed of 2, i can move in the air if i jump (yeah jumping works completely fine in the build) though the movement in air is still slowed.

My code: https://hatebin.com/awynhmhgso
Video of movement in the editor: https://i.gyazo.com/62558dc1da16ed3bb4b36d7fc3848155.mp4
Video of movement in build: https://i.gyazo.com/b3397df45f9be7465d5d15659c3f3a85.mp4

timid dove
#

You should also not generally multiply the time scale by the force

stuck bay
#

Oh yeah i know that was just debug code i left there

stuck bay
#

Oh NVM i know how to fix it

#

Thank you

timid dove
stuck bay
#

Yeah i just woke up

#

I just used a bool ofc

#

That updates in update and then my code checks if the bool is true in updatefixed

brisk lagoon
#

Hello, I recently had my gravity scale on my player set to 4. But when i changed it to something like 16, i click play and the gravity scale changes back to 4, but when i exit the game it automatically switches the 16 again

#

anyone know why?

brisk lagoon
#

shoot

#

you're right

feral spade
#

Question
So I have created a FPS controller with a RigidBody. The way I fixed that the character does not get stuck in a wall when it jumps at a wall is by having 2 capsule colliders on my Player. One capsule collider has a PhysicsMaterial with 0 friction. This collider has a bit bigger radius then the normal one and to avoid that it is sliding over the floor I have moved the capsule collider a small bit up. This seemed to work but my player get stuck on when I try to jump on platforms.

What is the right way to do this? How do you all do this?

stuck bay
#

If I have a navmesh agent, am I able to still update the position of its Transform manually? I have a drone "character" and its a navmeshagent and I had some code I built that made it slightly hover up and down like a drone should but for some reason it stopped working and im trying to figure out why, am not sure if maybe its because its a navmesh agent?

#
        // Calculate the bobbing motion using a sinusoidal wave function
        float y = amplitude * Mathf.Sin(0.2f * Mathf.PI * frequency * Time.time + offset);

        // Update the drone's position
        transform.position += new Vector3(0, y, 0);```

Here is the code, its weird because it was working fine for a few days then it randomly stopped working. Its in the beginning of an update function. The only change I can think of that I did was add an audiosource to the drone, but that should not effect that. And even removing the audiosource didnt fix it anyways but I assumed it was not that.
timid dove
#

the navmesh agent itself should not bob up and down

stuck bay
#

yeah that seemed to solve it

#

ty ty

split solar
#

Does a Physics2D.OverlapCircleNonAlloc store each found collider in order of how close it is to the circle's position?

#

Trying to cut out a LINQ OrderBy call that's being run every frame

split solar
#

ah

wary crater
#

Is there a way to affect an object with gravity but to also make the object not collide with anything?

timid dove
silent maple
silent maple
#

Oh wait yeah I forgot I accidentally did that one time and the GameObject kept falling through the map

wary crater
#

I removed box collider to prevent collision but now the blocks don’t move 🤔

silent maple
timid dove
#

show the object's inspector

wary crater
#

I’m outside so I wont be able to send pics unfortunately, but I have a rocket that has two blocks under it that are connected through a hinge

#

Acc when I get back home I can send pics and it’ll make everything easier haha

wary crater
#

so basically as i said i have a rocket with a tether that i want to move with

#

when i land on the plane with the tether, the rocket starts moving weirdly cause they all got collisions

forest lance
#

then don't have colliders on the blocks?

wary crater
#

it's cause without them the tether won't movie like in the gif

#

move*

wary crater
#

i also have the hinge joint but i don't think that helps with this problem

timid dove
#

or disable collisions between rocket and tether with layer based collisions

wary crater
#

this is the one right?

timid dove
wary crater
#

from what i've looked up i'd have to make a layer for the tether and a layer for the plane

#

and then uncheck the box that links to the two?

timid dove
#

if you want to remove collision between tether and plane, yes (as well as putting those objects on the appropriate layers)

wary crater
#

i see, tysm!

stuck bay
#

How to move 4 hinge joints with physics?
I tried AddTorque but it moved them poorly and only a little bit
However AddForceAtPosition actually moves them enough, but I'd have to do it at least 4 times for each joint

#

Im wondering which way is the best

timid dove
autumn jetty
#

Hey! I'm fairly new to using joints. I want a button that is physically pressable that moves as a spring between point A and B. Closest I've got is using configurable joint with setup in image. Is there a way to make sure the spring is only allowed to move in one direction (down), aka doesn't bounce up above its starting position?

misty wyvern
#

Hey, I have a "floating capsule collider" physics-based character controller, and since my capsule doesn't collide with the ground, I don't have the friction necessary to stop player when the input stops. What is the right way to simulate friction with ground on your own?

timid dove
#

in a practical sense, you should just add a force opposite the direction of any motion parallel to the surface when you're grounded

robust maple
#
  • In physics2d, there's a gap between any colliders. I don't want to remove it nor complain why it's here, just how to calculate its value? I suppose it's not fixed, then max possible value maybe?
#
  • For more context, i want to resize colliders automatically so that there's no gap between visual elements of the game, but also for inner logic that would take ages to explain
timid dove
robust maple
#
  • Lmao, so simple again. I can acess it in scripts as well, right?
#
  • Yep, i see. Excellent, thank you!
stuck bay
#

so i have assymetrical obj hierarchy with rigidbody on top but gravity keeps pushing the thing in the direction where the weight is heavier.
what can i do here? pivot point is on the center.
i guess rb is somehow distributing the rigidbody weight between its children and more children + bigger mess size on some side of the object will result in more graviy being applied in that direction

timid dove
#

But you can manually set the center of mass in code to whatever you want

lethal blaze
#

How can i make this CharacterController height only increase upwards not both ways. You can see it's stuttering and increasing both ways, is there any anchor point property or any way i can fix this

feral spade
#

I am working on a FPS Controller. It's a RigidBody setup. Everything works as it should except for the Jumping on objects part. In the video you can see what is happening. To fix this I can put a physics material on the crate with 0 friction. But when I run against the Crate it will slide of the floor like it is on ice. The same for when the player stand on top of the crate it will slowly slide of it.
So I am stuck on what to do now.. I think this is a physics things

fresh spear
#

make the box mass higher so it moves less?

feral spade
#

thanks but then I still have the effect that the player slides up on it when I move forward as in the video

rose pivot
#

Guys, who knows how to make a circle, not a ball?

unique cave
stuck bay
#

lets say 2 cars collide, how to make it so the impact of collision (or the force of collision) is smaller or nonexistent on one of the cars?

#

(other than increasing weight, and locking rb rot/pos, and drag/angulardrag, and iskinematic)

runic flame
#

Hello I was wondering if someone would be able to help me with this. I'm struggling to figure out how to simulate better physics on the balls where they will roll off each other and be more realistic like marbles or something. Right now they are just stacking on top of each other. I have rigidbody component added with a physics 2D material where there is 0 friction and 0.5 bounciness. I'm also having an issue with my object pooling but I can ask that in the scripting channel if it's not allowed here

timid dove
runic flame
#

I'm guessing I should just make the platform uneven so they don't align?

#

Or should I spawn them with a rotation?

timid dove
runic flame
cold gale
#

oh I fixed it turns out its because the object is static

tough path
#

Where the cube overpenetrates?

#

Changing the Collision Detection and Interpolate parameters on the Rigidbody changes nothing

#

Speculative CCD makes it a little better but it has some downsides that would not be suitable for my game

#

but for some reason, every object overpenetrates then bounces back up to where they're supposed to be

timid dove
#

Also are you moving these objects with your code, or allowing the physics engine/gravity to move them freely?

tough path
#

No it's just free-falling

timid dove
#

should be fine with Interpolate: Interpolate and Collision Detection: Continuous

tough path
#

nope lol doesn't change anything

tough path
timid dove
#

you sure it's overpenetrating and not just bouncing?

tough path
#

in this instance, the cube accelerates into the ground, and then comes to a rest at the surface

#

as opposed to hitting the ground, bouncing back up, then coming back down

#

I also created a physics material and set bounciness to 0 and minimum

tough path
#

I wouldn't say so

#

I mean it physically cannot bounce because the physics material is stopping it

#

so it can't be that

timid dove
#

goddamn quicktime player

#

it was supposed to save that in slow motion 🤣

tough path
#

this is the frame where it bounces

#

so it is definitely overpenetrating

tough path
#

anybody have an idea?

tough path
radiant fiber
#

Has anyone figured out a physics solution to manipulating a bucket in VR? specifically the collision setup and the hinge settings for the handle? no matter how I set mine up, the handle swings through the bucket lol

vernal trench
#

I want to make a something similar to a hinge joint with the configurable joint but it always rotates around the center of the object but I want it to rotate around the anchor or pivot. Does anyone know how to get a configurable joint to rotate around the pivot or anchor?

timid dove
#

forget which one

vernal trench
little chasm
#

Make sure to enable collisions between your bucket and handle rigidbodies in your configurable joint

dark oak
#

so i am making a dropper and my character does not take fall damage how do i handle kill blocks (colliders that player can not land on)?

#

should i apply the "death" function to every obstacle or just the player (onCollidertrigger) and tag compare and then run death function or anything else?

timid dove
dark oak
timid dove
#

100 objects with 1 script

#

why would you need 100 scripts?

dark oak
timid dove
#

That takes 1 second

#

besides it'd be a prefab

#

you add it once to the prefab

#

and it's done

dark oak
#

Ye but won't it hurt performace

timid dove
#

no

dark oak
#

I am confused isnt it better just to add tag check on collision to the player?

timid dove
#

don't prematurely optimize

timid dove
#

seems like a separation of concerns issue

#

each script should do one thing

#

a kill block kills players that touches it

#

a player just jumps around

#

It's much cleaner architecture

#

otherwise you're going to find that your player script is 4000 lines long and doing 80 different things

dark oak
#

I need a second opinion

#

I get what u are saying makes sense

timid dove
#

I can only offer my opinion, I can't force you to make any particular decision 🤷‍♂️

dark oak
#

I will ping u if you don't mind

#

Btw it is a mobile game casual

#

I have questions about patterns where should I ask

#

Like game managers and handling levels and player spawn , etc

broken zinc
#

Wondering if anyone can help me with this. I have a basic rigidbody and a capsule collider. I need it to start between two points and end between two different points. Both sets of points are known before hand so i just need to physics to move it between the two sets. I can get this to work with the position and velocity but i cant get rotation and angular velocity to work right. any thoughts on how to get this to work?

timid dove
#

maybe show how you're doing it for position

#

but based on just having "two points" I don't see how you are determining what the desired final rotation is (or what the starting rotation should be, for that matter)

#

basically step 1 is defining the problem better

broken zinc
# timid dove a lot of unsanswered questions about this: - When you say "Between" what do you ...

Sorry im not the best at explaining. Im doing rope physics. the rope is made up of a series of points. i think thats the standard way. The collider is positioned so that each end is at a two adjacent points. Then put a collider between each set of points and that would be the collision for the full rope.
The motion for the rope ive already done and that works perfectly. So i know where the colliders should move to, to match the motion of the rope

broken zinc
#

Bump cuz i am still looking for help on this

normal leaf
#

How do I freeze both the X and Y rotations. If I run this code it just freezes the Y rotation.


if (view2D)
        {
            rb.constraints = RigidbodyConstraints.FreezeRotationX;
            rb.constraints = RigidbodyConstraints.FreezeRotationY;
        }

        else
            rb.constraints = RigidbodyConstraints.None;
            
        }
inner thistle
timid dove
cedar carbon
#

idk if this is the right channel for this but im making a game and i wanna have like a cloth "door" type thing but how would i make the player able to walk throught the cloth

short needle
#

Hi, was wondering why my character is falling super insanely slowly, could it be due to animations?

dusk jackal
#

Check the mass

short needle
#

yo the tutorial im following shows how to fix it later but thanks anyways

dusk jackal
#

Np

lapis latch
#

hello

#

for natural movement, is there an agreed upon mass/drag ratio for a humanoid character?

#

I guess it would depend on stuff like velocity

dreamy stump
#

What do the joints components do?

unique cave
blissful flume
#

why tf is the joint teleporting when I toggle isKinematic
Edit: Solved, it was an issue with the joint settings, but I have come across one more issue - it turns to a weird position by itself (that is actually outside of the bounds I had set for it)

#

this is my joint settings - could someone give me a bit of advice here please?

wise bison
#

Hey guys

#

I recently came across this weird thing

#

Seems like theres a priority for fixed joints or something

#

I dont understand why one wing wiggles and the other one doesnt

#

And after swapping them the other one does that

#

I didnt find anything about it on the internet

lethal ocean
#

hello

#

so i have this issue where my car flies off if the wheel colliders are enabled

unique cave
# wise bison

Why are you using joints to begin with? Seems like that should be just one rigid body so parenting should be enough?

wise bison
#

So i can get netforce that controls flight

#

Otherwise i would have to use addtorque or something but i want it to be done using forces

unique cave
wise bison
#

Will try that

#

But anyways why would it do that with fixed joints i dont understand

unique cave
wise bison
#

Well i would have easier control over all variables for each surface

#

Also it is supposed to be something like kerbal space program

#

That i can connect and disconnect other wings

fickle cobalt
#

guys

#

i need help

#

so I added a wheel collider to my truck so I can drive it but its rotated sideways, I can't fix by rotating the gameobject and solutions?

wise bison
fickle cobalt
#

yeah it doesn't work

frozen star
#

Is there a proper way to do a Golf Swing?
Mainly the travel of the golf ball mid air? Trying to replicate Mario Golf or Wii Golf.

Currently am just using Unity and just basic force in a direction.
This game is networked, so the Golf Ball should ideally be visible to all three clients. Ideally also from the shot to the landing point in less than a second. I tried doing some basic add force to the golf ball and it felt a bit floaty. So then I just adjusted mass in editor but I don't think that is the right way to do it?

So mainly: I am trying to create a golf ball flying in mid-air that has a travel time of less than 1 second.
(Networked real-time, not turn based golf.)

#

(Also, how might someone do a slice or hook in golf without a timing based power gauge or an accelerometer in a remote?)

vernal owl
# wise bison

I've seen this glitch before, usually I'd just copy over the ridged one to replace the broken one but if you're trying to make an airplane building game you should ask vitsum

blissful flume
# blissful flume

Bumping, since it seems to have gotten lost, does anybody know a solution to this?

unique cave
unique cave
#

AddForceAtPosition also gives more control over the forces, now the force doesnt necessarily need to be added to the center of the plane parts

broken zinc
#

Is there a way to make colliders visible? im used to ue4 which has a setting for that and i need to see what my colliders are doing

hollow echo
#

Then check the Collision Geometry checkbox in the scene view

broken zinc
#

cool thanks

dreamy stump
#

I have a problem. When I jump the object reaches its max height almost instantly then falls extremely slowly. The objects scale is 1 for each axis and I have to scale the gravity to 9.81x33 for it to feel similar to earth gravity. Can anybody help me?

woven relic
timid dove
#

stop doing those things and it'll work normally 😉

dreamy stump
woven relic
# dreamy stump Rigid body

you might need to post the code, it seems like you could be resetting the velocity as PraetorBlue said

timid dove
#

definitely resetting velocity. the "super slow falling" thing is the classic sign of that

serene ore
#

Anyone know if you can use CCD ik for a rigidbody with Joints?

wind wadi
#

Hey guys! quick question that I wanted to prod the community about haha.

#

I've noticed when working with multiple Unity physics scenes (for 2d) OnEnable is fired again when a gameobject is moved to a new physics scene.

#

Is this intended, or is this a bug within Unity?

timid dove
#

If you can reproduce it I'd submit a bug report.

wind wadi
#

Was thinking the same thing

#

Definitely can repro. Have a unit test built out for it

timid dove
#

Are you sure you're not disabling it at any point?

wind wadi
#

As far as I can tell. I can boil it down a bit more though just to be sure

#

Will get back to you haha

#
        [UnityTest]
        public IEnumerator OnEnableDoesNotExecuteAgainOnMoveToNewScene() => UniTask.ToCoroutine(async () =>
        {
            // Arrange
            var onEnableCount = 0;

            // Act
            SceneManager.CreateScene("Basic Level Helper", new CreateSceneParameters());
            var onEnableTestGo = new GameObject("On Enable Test Go");
            onEnableTestGo.OnEnableAsObservable().Subscribe(x => onEnableCount++);
            SceneManager.CreateScene("Basic Level", new CreateSceneParameters());
            await UniTask.WaitUntil(() => SceneManager.SetActiveScene(SceneManager.GetSceneByName("Basic Level")));
            SceneManager.MoveGameObjectToScene(onEnableTestGo.gameObject, SceneManager.GetSceneByName("Basic Level"));

            // Assert
            Assert.Zero(onEnableCount);
        });

        [UnityTest]
        public IEnumerator OnEnableExecutesAgainOnMoveToNewPhysicsScene() => UniTask.ToCoroutine(async () =>
        {
            // Arrange
            var onEnableCount = 0;

            // Act
            SceneManager.CreateScene("Basic Level Helper", new CreateSceneParameters());
            var onEnableTestGo = new GameObject("On Enable Test Go");
            onEnableTestGo.OnEnableAsObservable().Subscribe(x => onEnableCount++);
            SceneManager.CreateScene("Basic Level", new CreateSceneParameters(LocalPhysicsMode.Physics2D));
            await UniTask.WaitUntil(() => SceneManager.SetActiveScene(SceneManager.GetSceneByName("Basic Level")));
            SceneManager.MoveGameObjectToScene(onEnableTestGo.gameObject, SceneManager.GetSceneByName("Basic Level"));

            // Assert
            Assert.AreEqual(1, onEnableCount);
        });
serene ore
#

Any rigidbody Ik solutions?

wind wadi
chrome cradle
#

Hey, there.

How to reduce slip in wheel colliders?
I have been modifying Sideways Frictions values and Forward Friction values, but can't figure it out.

My wheels are constantly turning left or right uncontrollably.

wintry sky
#

Good afternoon, I have a question about a movement I'm doing, currently I have a vehicle that moves by physics and I would like to make this could not hit the walls and slide down these, does anyone know any way to do it, if with raycasts or some mathematical formula similar to PID?

timid dove
solemn talon
#

Hi, so im trying to create something like "Learn To Fly" in unity but cant really get the gliding.
So i have this box with rigidbody and i want to make it glide depending on the angle of attack.
can anybody help?
i just shoot it towards the ball

viral beacon
#

Does anyone know if theres a specific amount of mass difference between jointed objects that wont dramatically affect the performance of the joint?

bright sluice
#

hi, how can I turn the wheel collider to correspond with the real wheel ?

timid dove
#

the wheel collider is always aligned with the object's +z axis (forward axis)

#

It's your 3D model that is misaligned

#

The blue arrow is forward

#

your model seems to be facing -X

bright sluice
#

so I found this answer on unity answers but...

broken zinc
#

Is it possible that two colliders that are set to ignore each other could still affect each other? I have a series of colliders that slightly overlap and seem to be interfering with each other but if i set them to triggers they behave as i expect.

timid dove
broken zinc
timid dove
#

And when is that code running

broken zinc
#

the reference is from adding the colliders in a script. a .AddComponent<CapsuleCollider>() and then the IgnoreCollision is done. it all originates from the start function.

broken zinc
broken zinc
#

rigs = new ColliderGroup[segments];
for (int i = 0; i < rigs.Length; i++)
{
GameObject g = new GameObject();
Rigidbody r = g.AddComponent<Rigidbody>();
r.mass = 0.6f;
r.drag = 0f;
r.angularDrag = 0f;
r.useGravity = false;
r.isKinematic = false;
r.constraints = RigidbodyConstraints.None;
CapsuleCollider cap = g.AddComponent<CapsuleCollider>();
cap.isTrigger = false;
cap.radius = 0.01f;
cap.height = 0f;
cap.direction = 2;
cap.material = pm;
rigs[i] = new ColliderGroup(g, r, cap);
}

        for (int i = 0; i < rigs.Length; i++)
        {
            for (int j = i + 1; j < rigs.Length; j++)
            {
                Physics.IgnoreCollision(rigs[i].c, rigs[j].c);
            }
        }
#

thats all called from the start function and the ColliderGroup is just a class to hold a reference for the gameobject, rigidbody and collider. it doesnt do anything else

#

and like i said, if i set the istrigger to true everything works perfectly, apart from collision obviously

timid dove
#

Also for sharing code here:

#

!code

flint portalBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

broken zinc
#
public class ColliderGroup {
        public GameObject obj;
        public Rigidbody rb;
        public CapsuleCollider c;

        public ColliderGroup(GameObject obj, Rigidbody rb, CapsuleCollider c)
        {
            this.obj = obj;
            this.rb = rb;
            this.c = c;
        }
    }
broken zinc
rustic raptor
#

I'm trying to create my own custom interaction toolkit for a VR game that I'm working on. So far I have a Interactor and a Interactable class which are applied to a player's hands and grabbable objects respectively. When a player grabs an object I create a InteractionInfo object which stores some useful information about the position and rotation of the grab https://pastebin.com/bVZx6tnC. Then during every FixedUpdate call inside the Interactable class I update the position and rotation accordingly https://pastebin.com/wb7D0qC8. My problem is that there is a pretty noticeable delay when the objects tries to track the Interactor's position and there is also a considerable amount of jitter whether the Interactor is moving or not and then finally when an Interactor grabs onto an object with a HingeJoint component like a door or a lever then the object freaks out and jitters between the Interactor's hand and rotation and the joint's position and rotation which I was told wouldn't happen if I use MovePosition and MoveRotation on the rigidbody. I've tried other things as well like ``` _rigidbody.velocity *= (-1 * _dampenFactor);

  Vector3 velcoity = (targetPos - transform.position) / Time.deltaTime;
  _ridigbody.velocity += (velocity * _scalingFactor);``` instead of `MovePosition` inside the FixedUpdate method however this just makes things worse but ends up giving me the same result as `MovePosition` if I put it inside the `Update` or `LateUpdate` method.
unique cave
viral cove
#

I have a quite specific and unique question but are there any sources that list all the major changes to physics engines in various versions of unity?

timid dove
viral cove
#

Well, "major" in quotation marks

#

Like moving to a different version of physX

#

Also, I can't really find any information about 2D Physics engine outside of the fact that it at some point was using Box2D

#

But does it still use it?

#

Or what was before it?

#

I can't find anything

timid dove
#

always has in living memory afaik

unique cave
viral cove
#

The more recent changes to physX I was able to find

#

In that particular subject I'm more interested in period between Unity 1 and Unity 5

#

Ok, I've managed to find that Box2D was introduced in Unity 4.3 version

#

Just to make sure

#

Before it there wasn't any official 2d physics engine in unity?

#

And it is used since then up until now?

timid dove
viral cove
timid dove
#

¯_(ツ)_/¯

#

Or just an oversight, or who knows

viral cove
#

One more question just to be sure

#

Currently used version of PhysX in lates versions of unity is PhysX 4.1, right?

twilit plank
#

Hello guys, I am trying to redo the antenna from hillclimb racing: Basically when your car moves, the antenna behaves like it has some mass, so i need to implement some kind of inertia. I was playing around with all kinds of joints, but I cannot figure out what to use.
What I already did is, I connected five short rectangle rigidbodies to another with FixedJoint2D, but it is stiff. Can someone help me with this?

uneven pine
twilit plank
#

yes!

uneven pine
#

I do not really know any of unity's joints, I can give you an alternative option tho

twilit plank
#

that would be awesome 🙂

uneven pine
# twilit plank that would be awesome 🙂

you can do it inside the vertex shader, with some math, kind of like grass swaying in the wind but velocity dependent, if you do not know how to write shaders ¯_(ツ)_/¯

twilit plank
#

I can have a look at that, but it seems way too advanced for me, I just started doing unity like a week ago

onyx vault
#

how can i completely disable a 3d rigidbody?

#

setting it to IsKinematic = true and enableCollisions = false still syncs the RB transform

#

and its super slow

timid dove
#

"super slow" would be down to your code, as a kinematic RB only moves exactly as the code tells it to

#

unless you mean slow computationally

#

In that case, destroy the RB.

onyx vault
#

it takes a significant chunk of frametime

#

i have 100 zombies, and i have them animated as well as with a ragdoll state

#

in ragdoll, physics should be enabled

#

in animated, there should be no RB syncing at all

timid dove
onyx vault
#

thats the other issue

onyx vault
timid dove
#

destroy the joint too

onyx vault
#

and i really dont want to add 2 components to every joint on the body every time one is killed

timid dove
#

or rather, create these things at the moment you wish to become a ragdoll

onyx vault
#

there has to be a better way

timid dove
#

make two prefabs

onyx vault
#

it seems so slow like that

onyx vault
timid dove
#

the animated one, and the ragdoll one

onyx vault
#

its so annoying

viral cove
#

might be a dumb question but can't you just disable those components when you don't need them?

timid dove
arctic marsh
#

What was the original question, did not follow 😄 you trying to do a ragdoll?

azure arch
#

Is there a way to make a bridge work with wheel joint with a motor? I can't have my car to accelerate on a physics bridge

onyx vault
#

i have a workaround tho. i duplicate the colliders and update their positions manually

arctic marsh
#

Isnt there a ragdoll option anyways?

onyx vault
#

i already have a ragdoll lol thats not the issue

arctic marsh
#

Ohh okay, thought the setup of your ragdoll is the issue

onyx vault
#

the issue is performance while the ragdoll isnt active

arctic marsh
#

Did you set it up yourself or with the ragdoll thing from unity?

onyx vault
#

ragdoll wizard

onyx vault
#

like, over 3x faster

#

went from 90 avg to 250 avg fps

dark monolith
#

Does anyone know any common gotchas with things not bouncing off meshes that have bouncy physics materials applied? I’m making a pool table and the balls just stop dead on the cushions.

blissful flume
silent mural
#

hello, Visual studio picks the wrong overload for raycast, and its driving me insane.

RaycastHit hit;
Ray ray = new Ray(transform.position, transform.TransformDirection(Vector3.forward));  
bool doesHit = Physics.Raycast(ray, hit ); //error cant convert ray to vector3
//wanted overload -> public static bool Raycast(Ray ray, out RaycastHit hitInfo);
//used overload ->         public static bool Raycast(Vector3 origin, Vector3 direction, [Internal.DefaultValue("Mathf.Infinity")] float maxDistance, [Internal.DefaultValue("DefaultRaycastLayers")] int layerMask, [Internal.DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction);

proud nova
#

C# doesn't allow ambiguous cases with overloads afaik.

silent mural
#

yeah well its refusing to pick the correct one.
the only overload that works is just "Raycast(Ray)"

#

its not ambigous tho, since everything is clearly typed. i dont know how it can even pick the wrong one to begin with

proud nova
#

You are missing 2 parameters in the code you posted

silent mural
#

yeah sry, the overload should have been this one.
public static bool Raycast(Ray ray, out RaycastHit hitInfo);

#

regardless, the 4 param one also doesnt work

#

as soon as its more than 1 parameter, it defaults to some vector overload, and then throws an error

proud nova
#

You are missing the out keyword

silent mural
#

oof

#

well, guess i dont get around actually looking at c# syntax lol
thanks dude

radiant fiber
#

anyone know of a tutorial for unity physics hinged objects? I setup the hinge joint and it's limits but it seems to want to chaotically vibrate all over the place and when the parent object moves it doesn't take the hinged element with it...

timid dove
radiant fiber
#

it's a scene prop so I'd like it to react to explosions nearby. parent object has a rigid body and a box collider.

#

any suggestions appreciated, I have to run to pick up the kids, thanks all!

timid dove
#

if you want this object to react independently via physics, it needs its own Rigidbody and its own collider

pulsar gulch
#

I think I found a bug:
These two screenshots illustrate the issue, if the trigger is bellow a certain height compared to a plain old 2m capsule character controller, it will not trigger OnTriggerEnter()/Exit() events, if it is moved slightly higher, it will trigger.

#

Yellow box is a BoxCollider with "Trigger" setting turned on.

dark ravine
#

I am so confused on this. Why is the player colliding with the wall..?

#

I lowered the player's collider height and that seems to fix the problem but as you can see, there is clearly a lot of room for the player to fit through so..

#

Lowering the height by 0.03 fixes it...

#

Why might this be happening?

timid dove
# dark ravine

Are you using CharacterController? It has a "skin width"

dark ravine
#

The width skin is only 0.08 though

#

I don't think from the top of the player to the top of the doorframe is 0.08

#

Also if it would be the case, then it would also be an issue with the width of the player which it is not

woeful pulsar
#

If the drag formula is
dragApplied = Mathf.Clamp01(1f - drag * Time.fixedDeltaTime)
How can I determine what force to apply to a rigidbody to observe a relatively similar impact regardless of the rb's drag value?

#

Use case is a creature with physics based movement. When grounded, drag is set to a relatively high value to make the controller feel more rigid, whereas when the creature is no longer grounded, only g is applied and drag is set to 0.

Controller feels good, I'd like to keep it that way. Bullets hitting the creature are a problem since bullets carry direction/force data but do not account for the rb's drag.

timid dove
azure arch
bold crystal
charred pilot
#

hey, i have this tilemap collider on my tilemap and my player is getting stuck on corners, i saw that u need to use composite collider and a rigidbody to make it one single collider and not one collider for each tile, and it worked, my player wasn't getting stuck on corners but now, when my player moves horizontally, he change's his "y velocity", just like he was jumping, i really can't find any solution
rigidbody in tilemap collider is set to static, and tilemap collider have used by composite checked
my player settings:

charred pilot
#

omfg, all i had to was to change composite collider geometry type to polygons

#

oh, wait, no, it didn't fix

#

i changed geometry type to polygons and it worked for one debug, and then it didn't

charred pilot
#

So does anyone know what's happening?

tribal path
#

i'm trying to simulate a kind of chain with each chain segment connected to the last with a hinge joint. However when the hook where they are all connected at the top moves too fast the segments at the end lag behind quite a lot and it looks unatural. From my research this is kinda what the joints are meant to do, but it just doesn't seem right. Does anyone know of an alternative that keeps each segment perminantly a fix distance from the last, but alloying rotation?

blissful saddle
#

Are articulated bodies more stable/accurate than joints? e.g. is a ConfigurableJoint set up as a hinge inferior to a Revolute Joint in an articulation? I ask because I ported a rope I made out of Revolute Joints in Box2d, which was quite stable and "felt" good to Unity, set up via ConfigurableJoints that are set to also act like a hinge), and it's ... not great. It's "bouncier" (???), seems to dampen poorly or have some kind of feedback ("shivering"), goes crazy under extreme gravity (box2d rope could handle 100x gravity while staying stable) ... would I have better luck using an articulated body for this? Is there just a better way to make a rope in Unity?

timid dove
#

depends what your requirements are for the rope

dark ravine
blissful saddle
#

I find the Configurable Joints definitely seem to stretch beyond their linear limit on the regular. Maybe I'm doing something wrong there?

blissful saddle
#

"inelastic, low tension" maybe to put it in physics terms

timid dove
#

what is the rope for

#

is it visual only

#

is the player swinging from it

#

are there requirements to the swing, like it needs to always reach a same platform or something

blissful saddle
#

it's hung from a fixed position and the player induces forces on the end of it to make it swing

#

btw, it only moves in xy dimensions, but i think that's just a detail. the overall scene is still 3d

timid dove
#

If some games have done it already then obviously it's possible

coarse hamlet
#

https://i.imgur.com/Ie3D7re.png

any idea why this would be happening?
the small enemy on the right has sort of a buffer between its collider2D and the composite collider terrain... my player and other entities dont have this issue though

coarse hamlet
#

actually my player does have that buffer too, I was looking at the wrong box for their physical collider

supple sparrow
#

What happens if you play with the Y Offset of the box collider on your screenshot ? Also did you try messing with the sprite pivot ?

vale grail
#

I'm trying to make a motorcycle with the build in wheel colliders. What approach would you use to keep the motorcycle upright? Apply angular momentum every time it starts to fall to one side?? Or are there other solutions?

coarse hamlet
#

there is a small gap about 0.04 wide between thm

silent mural
#

im a bit confused about torque.
i have a small astronaut (2m) and a bigger ship (20m).
they get the same rotational force compared to their mass.
(its 1f * rigidbody.mass), and yet the astronaut spins like crazy, the ship is suuuper slow to rotate.

        rb.AddRelativeTorque(localAxis * value * rcsForce);    //idk why it needs more force
#

i was under the impression that:
equal mass
equal torque
=> equal rotational velocity?

#

well, it seem that when i use the same sized collider, the rotation is equal.

timid dove
#

the relevant thing is the inertia tensor

#

which changes with different shapes

#

Think about a long stick. You need more torque to rotate it around the long axis than the short one.

silent mural
#

yes thanks. chatGPT told me something similar lol
i see that the interia tensor is a matrix, stating the interia for each axis

fringe kayak
#

While using a rigidbody, I notice that the player( in this case, a cube) will rotate or be spun by the collision of other objects. How do I lock the rotation so that the cube does not rotate at all?

timid dove
#

simply constrain the rotation as you wish

fringe kayak
#

okay

#

thanx

lunar tulip
#

hey guys, i have problems with a little rocket simulator i am making. I am trying to rotate the rocket based on input, and it works fine when rotating counter-clockwise but not when rotating clockwise. it is as if the rocket tries to smoothly clamp on 90 degrees. also when rotating counter clockwise, it rotates faster at the 90 degrees point
Code:

void FixedUpdate()
{
    rb = currentRocket.transform.GetComponent<Rigidbody2D>();
    rb.mass = currentRocket.getTotalMassOfRocket();
    CenterOfMass.transform.localPosition = currentRocket.getCenterOfMass();
    if (canControllRocket())
    {
        rb.AddForceAtPosition(currentRocket.totalAccelerationForce * Throttle, CenterOfMass.transform.position);

        rb.AddTorque(-rotF * currentRocket.totalRawAccelerationForce * Throttle * 0.005f, ForceMode2D.Impulse);
    }
}

Input is dealt here (is called in Update() );

if (Input.GetKey(KeyCode.LeftShift))
    Throttle = Mathf.Min(Throttle + 0.005f, 1);
if (Input.GetKey(KeyCode.LeftControl))
    Throttle = Mathf.Max(Throttle - 0.005f, 0);

float RotL = 0;
float RotR = 0;
rotF = 0;

if(Input.GetKey(KeyCode.A)) RotL = -1;
if(Input.GetKey(KeyCode.D)) RotR = 1;

rotF = RotL + RotR;
timid dove
#

maybe your center of mass is off kilter

#

resulting in a torque from that call

#

what happens if you just use normal AddForce

lunar tulip
#

i checked, its at the right position

lunar tulip
#

THAT WORKS?

#

yes, it does, now i am even more confused. how will i take center of mass into account now?

timid dove
#

you know Rigidbody2D has its own centerOfMass property, yes?

lunar tulip
#

rocket consists of many parts, i dont know how i would handle that

#

manny parts with changing mass yk?

timid dove
lunar tulip
#

performance

timid dove
lunar tulip
#

when having multiple engines, like 100 or so, i would add force on each individual one, but if i instead at force at the center of mass, no problems

lunar tulip
timid dove
lunar tulip
#

it does?

timid dove
#

no need to do AddForceAtPosition

bold canopy
#

I think that's how rockets work, so they try to imitate that

lunar tulip
#

should i?

timid dove
#

it depends how you want your game to work

lunar tulip
#

but shouldnt it have the same effect?

timid dove
#

if you want rockets to always work fine, add force at center of mass.
If you want it to be more "realistic" and allow the player to screw things up, add force at the engines

lunar tulip
#

okok

#

but then i do need AddForceAtPosition, no?

bold canopy
#

I think you will have to take the localposition of the engine when using AddForceAtPosition

lunar tulip
#

yea

bold canopy
#

If the engine is a child of your rocket of course

lunar tulip
#

it is

bold canopy
#

My bad

lunar tulip
#

so iterate through each engine and do AddForceAtPosition at its localposition on the rocket rb?

bold canopy
#

The position is in world coordinate

#

So you just have to take the position of your engine (engine.transform.position)

timid dove
#

AddForceAtPosition uses world space positions

lunar tulip
#

yes

bold canopy
#

Yep I double checked after that, I wasn't sure

#

You can either iterate over all your engines from the rocket script which I assume would be attach to the rocket game Object, or you can create an engine script, that will take the rigidbody of your rocket and add a force at the engine position to it

#

Probably better for you to have an engine script, that way, if you want to modify the force added to the rocket, it's easier

lunar tulip
#

uhm

#

problem is back

#

the bounce thing at 90 degrees

bold canopy
#

?

bold canopy
#

Nah I saw that, but what do you use for the rotation?

#

Consider the engine system we talked about will probably counter that, and make the physics more realistic for your game...

lunar tulip
#

wdym by rotation?

#

i use rb.AddTorque()

timid dove
bold canopy
#

Yeah add torque is a way to rotate the rigidbody... Using the system for the engines we talked about earlier, you just have to create two engines at the base of your rocket and active one or the other depending on the input

lunar tulip
#

oh no i may have found the error

bold canopy
#

if you apply that system you end up with something like this :

lunar tulip
#

i have found the error, everything is fixed, unless...

#

when gravity pulls down on the rocket, shouldnt it fly in the direction its flying with the center of mass pointing forward?

#

like this

#

because for me, it isnt, and the rb's center of mass is properly set up

bold canopy
#

what's the value of your angular drag in your RB?

lunar tulip
#

1, it confuses me anyway

bold canopy
#

put it at 0

lunar tulip
#

Isn’t that hella unrealistic?

bold canopy
#

"Drag is the tendency of an object to slow down due to friction with the air or water that surrounds it. The angular drag applies to rotational movement and is set up separately from the linear drag that affects positional movement. A higher value of angular drag will cause an object's rotation to come to rest more quickly following a collision or torque."

#

I mean you can tweak the value to get the result you want but for now just put it at zero just to ensure it is what causes your rocket to slow its rotation when falling down

lunar tulip
#

I will try that shortly, I am still struggling with setting mass, engine force and everything else up, everything would be a lot easier if floating point precision wouldn’t exist

#

I mean in games like ksp or sfs you can just fly out the distance you want and you won’t get any fpp issues

bold canopy
#

fpp?

lunar tulip
#

Floating point precision

#

For position

lunar tulip
bold canopy
#

if fpp is an issue for you you can just round it to a decimal? Mathf.Round(yourValue * 10f) /10f with that formula, you get your value rounded to the first number after the point

#

then maybe the center of mass of your rocket isn't set right?

lunar tulip
#

no i mean when flying out huge distances, say you want to fly to 3 * 10E9. you will get huge fpp isues because the higher the position is, the less precise decimal points you get

#

it is

#

i double checked

bold canopy
#

oh, yeah if we are talking about world coordinate, it's a problem

lunar tulip
#

i still have that com object, and its local position is alligned to the rb's center of mass

bold canopy
#

can you do a Gizmos DrawSphere and show me where your sphere is located relative to your rocket?

lunar tulip
#

how can i focus on something in scene view?

#

so that the scenes 'camera' follows an object

bold canopy
#

honestly, don't know, just pause the game and go to your rocket location,

lunar tulip
#

there it is, the gray sphere

#

maybe i should put gravity scale to zero and apply force at the COM pointing down manually?

bold canopy
#

if you really want your rocket to go back to its original position afterward, I'd do a Vector3.dot between the transform.up of my rocket and Vector3.Up, it will return 1 if both vectors are facing the same direction, -1 if they point in opposite direction, and 0 if they are perpendicular, then I would clamp that value between 0 and 1, and do 1f - yourValue, that way if your rocket is already upright, your value is at 0, otherwise if perpendicular or pointing down, it give you 1, then using Quaternion.Lerp, I would Lerp between the rotation of my rocket, and Quaternion.LookAt(Vector3.Up), and for the time parameter, I'd take the value I calculated and multiply it by DeltaTime, and an additional value, which would be the max speed at which I want my rocket to rotate

#

Something Like that

lunar tulip
#

uhm yea

#

it rotated on the wrong axis xD

bold canopy
#

what do you mean?

lunar tulip
#

it rotates on the x and y axis, not on the z axis

#

lol

bold canopy
#

when you select your rocket, which arrow point upward? blue green or red?

lunar tulip
#

green

bold canopy
#

okay so it's indeed transform.up

#

try Quaternion.LookRotation(Vector3.forward)?

lunar tulip
#

doesnt seem to work

#

i am falling straight down but rocket is pointed to a different direction

bold canopy
#

Do that instead ? : rocket.transform.eulerAngles = Vector2.Lerp(rocket.transform.eulerAngles, Vector2.zero, rotationSpeedLerp);

lunar tulip
#

now i cant rotate one bit

bold canopy
#

elaborate

lunar tulip
#

rotation is very little and hard

bold canopy
#

you obviously want this function to be called when no input is pressed

lunar tulip
#

like i can only rotate the rocket to +- 4,875 degrees

bold canopy
#

I mean, if you call it everytime in the update method, it will obviously always try to lerp the euler angles up right...

lunar tulip
#

it just snaps to the old position when no input is pressed

bold canopy
#

it changes the position of your rocket?

lunar tulip
#

rotation* sorry

bold canopy
#

can I send you a private message?

lunar tulip
#

yes

shadow anchor
#

Been a while since I used the physics engine in unity - I'm doing some ML research using ml agents

#

I get some clipping issues as you can see above, any idea what is wrong with my settings?

#

Ball rigidbody is

#

Platform cubes are all set to

#

Setting the platform to be kinematic with a high mass seems to have helped

inner spruce
shadow anchor
#

sadly it's a little more complex - I'm using ML so can't do that

#
public override void Heuristic(in ActionBuffers actionsOut)
    {
        ActionSegment<float> continuousActionsOut = actionsOut.ContinuousActions;
        continuousActionsOut[0] = -Mouse.current.delta.x.ReadValue();
        continuousActionsOut[1] = Mouse.current.delta.y.ReadValue();
    }```
```csharp
public override void OnActionReceived(ActionBuffers actions)
    {
        const float angleThreshold = 0.25f;

        const float fallFailureReward = -1f;
        const float successReward = 2f;

        float zAngle = 2f * Mathf.Clamp(actions.ContinuousActions[0], -1f, 1f);
        float xAngle = 2f * Mathf.Clamp(actions.ContinuousActions[1], -1f, 1f);

        AddReward(-0.001f);

        // Reduce the reward if the platform has over rotated
        if ( (platform.transform.rotation.z <  angleThreshold && zAngle > 0f) ||
             (platform.transform.rotation.z > -angleThreshold && zAngle < 0f))
        {
            platform.gameObject.transform.Rotate(new Vector3(0, 0, 1), zAngle);
        }

        if ( (platform.transform.rotation.x <  angleThreshold && xAngle > 0f) ||
             (platform.transform.rotation.x > -angleThreshold && xAngle < 0f))
        {
            platform.gameObject.transform.Rotate(new Vector3(1, 0, 0), xAngle);
        }     
        

        // Calculate Rewards

        if (ball.transform.position.y < ballFallenThreshold)
        {
            SetReward(fallFailureReward);
            EndEpisode();
        }

        if (goalReached)
        {
            SetReward(successReward);
            EndEpisode();
        }
    }```
#

I guess I should use Rigidbody.rotation instead?

shadow anchor
#

The trouble is, I have a load of different cube objects all parented under one object

#

which is what I'm rotated

#

That parent object doesn't have any colliders or rigidbodies of it's own

inner spruce
shadow anchor
#

Yeah that makes sense to me, cheers

#

Will let this kinda janky model finish training then see how that works

inner spruce
shadow anchor
#

Thanks! Would definitely recommend, it' super cool

shadow anchor
inner spruce
#

It seems like a 100g ball getting moved by a 100kg box field thing

shadow anchor
#

changing the mass from 1 to 1000 doesn't have a noticeable difference

#

the mass of the platform is 1 now

inner spruce
shadow anchor
#

yup

inner spruce
robust maple
#
  • Not valid anymore but just out of curiosity: how do i move a kinematic 2d body with respect to other colliders in the scene? I tried both velocity and move position approaches, but in either option the body just clips through things. Am i supposed to react to collisions manually?
inner spruce
#

What about the interpolation settings? Can you set the both to Interpolate?

shadow anchor
#

No obvious change setting them both to interpolated

inner spruce
#

Or maybe that's just the GIF.

shadow anchor
#

I think that is just the gif

inner spruce
shadow anchor
#

Sure

#

Ball

#

platform

inner spruce
shadow anchor
#

the objects all fall/break apart if it's off

inner spruce
#

I'm just searching here btw, I always find this stuff rather obscure. If you want to wait for someone who knows more that's fine with me.
Okay, can you freeze the whole thing. It should still listen to the MoveRotation then.

#

Also, everything from the object is a child of the platform right? You followed the compound collider text?

shadow anchor
#

I appreciate your help, don't worry

#

Everything is a child of the platform, yup

#

Kinematic off and with everything frozen fixes it breaking apart (I didn't realise that freezing stuff would still allow the rotation)

#

it does however stop collisions altogether

inner spruce
shadow anchor
#

lol

inner spruce
#

Grr...

shadow anchor
#

I find this is the problem with unity physics stuff, it's a bit finnicky

#

I've ran into similar issues before, it's usually a matter of the right combo of settings in the colliders and rigidbodies

inner spruce
#

Exactly, it can work, just figuring out how is a pain.

shadow anchor
#

In case anyone else takes a look, I'll summarise the current setup:
Ball with a rigidbody like this is not colliding properly with the platform

#

Platform is being moved using rigidbody.MoveRotation() and is setup like so

#

It has a number of child objects that have cube or mesh colliders

shadow anchor
inner spruce
shadow anchor
#

yeah lol

#

I'm using version control so it's no biggie to go back

inner spruce
#

Especially that part.

#

But that kills the fact that you roll off it. I don't know why that is, maybe it's the physics material that does that. Then maybe you can use that.

shadow anchor
#

That seems to be more about implementing player controls for moving the ball rather than collisions

#

Setting the platform to be kinematic brings me back to the collisions working but the ball being super "bouncy"

inner spruce
#

His plane and ball should probably have them setup so that doesn't happen.

inner spruce
shadow anchor
#

Done already I'm afraid

inner spruce
shadow anchor
#

yup

inner spruce
# shadow anchor yup

So you already tried it with a ball with a physics material then? I'm confused.

shadow anchor
#

I've never had a physics material set

inner spruce
shadow anchor
#

ah I see

#

That does help a bit actually, thanks

inner spruce
shadow anchor
#

thanks

serene wigeon
#

Hello everyone, Im having a bit of trouble with my VR game,
Im trying to make the ball in video A be like Video B but in video A its super janky and i have absolutely no idea why

#

The ball in video A doesnt seem to carry over any momentum from my arm in the hand collission

#

please @ me if you decide to help me :)

timid dove
#

you're just letting the XR rig move it

#

which is not physics

#

typically you would do something like have an invisible kinematic Rigidbody version of the hand which follows the XR hand in FixedUpdate with MovePosition and MoveRotation

serene wigeon
#

i was thinking id have to apply the motion by code, if you look at video B
Theres 2 different ways to hit the ball- With and Without a glove. a glove amplifies the strength of the hit by a large amount

timid dove
#

that is the object that will actually collide with the ball and apply realistic physical effects to it

timid dove
#

by placing objects
giving them components

#

writing some code

serene wigeon
#

Im not sure if what you are suggesting is what im looking for. Have you checked the 2nd video, the way it feels its as if as soon as the object is hit. an instant force is applied to the ball. it doesnt nessesarily feel natural

timid dove
#

all of that is doable

#

with the setup I explained

#

if you want to apply extra forces etc you can use OnCollisionEnter on the hand follower

serene wigeon
# timid dove all of that is doable

does this seem right?
https://youtu.be/VG8hLKyTiJQ

In this video I'll show you how you can setup hand presence with realistic physics behaviour in a step by step tutorial for Unity.

▶ SUBSCRIBE : http://www.youtube.com/channel/UC-BligqNSwG0krJDfaPhytw?sub_confirmation=1
▶ PATREON : https://www.patreon.com/ValemVR
▶ DISCORD: https://discord.gg/5uhRegs
▶ MAIN CHANNEL : http://www.youtube.com/Vale...

▶ Play video
timid dove
#

idk, don't have time to watch it atm

serene wigeon
#

👍

#

or just by the title?

#

wait @timid dove i just noticed in the player script for my rig i imported i noticed this

#

does this have anything to do with it

timid dove
#

what about it

serene wigeon
#

the hand followers

timid dove
#

I have no idea

serene wigeon
#

oh

timid dove
#

I'd expect them to be Rigidbodies

#

so idk

serene wigeon
#

ah, well the rig i have setup the player walks with their hands

#

like arms = legs

keen harness
#

I don't know why but for some reason enemy ragdolls always fly backwards no matter where they are shot

#
    void Fire() //fire weapons
    {
        for (int i = 0; i < weapdata.bulletpershot; i++) //determines amount of bullets fired per shot
        {
            float x_sp = Random.Range(-weapdata.spread, weapdata.spread); //horizontal spread
            float y_sp = Random.Range(-weapdata.spread, weapdata.spread); //vertical spread

            //calculate direction with spread
            Vector3 direction = shootpoint.transform.forward + new Vector3(x_sp, y_sp, 0);

            //hitscan
            RaycastHit rhit;
            if (Physics.Raycast(shootpoint.transform.position, direction, out rhit, weapdata.range, bulletcoll))
            {
                if (rhit.collider.TryGetComponent(out EnemyBPHitbox ehp))
                {
                    ehp.DamageTaken(weapdata.damage);
                    Instantiate(ehp.hiteffect, rhit.point, Quaternion.LookRotation(rhit.normal));
                    Debug.Log(ehp.name);
                }

                if (rhit.collider.TryGetComponent(out Rigidbody rbod))
                {
                    rbod.AddForce(rhit.normal,ForceMode.Impulse);
                }

            }
            Debug.DrawRay(shootpoint.transform.position, direction, Color.red, 2, false);
        }
        firespeed = weapdata.firerate;
    }```
#

and in my enemy ragdoll script

#
    {
        anim.enabled = false;
        foreach (Rigidbody rigid in ragdollrigbod)
        {
            rigid.isKinematic = false;
            rigid.velocity = Vector3.zero;
        }
    }```
#

not sure if this is a programming thing or a physics thing

misty wyvern
#

Hey, I have a spaceship that travels from point A to point B. It can accelerate with a known speed, and use brakes to stop. My goal is to make an algorithm that will tell the ship when to accelerate, and when to use breaks so that it would arrive to a destination with a zero velocity. Any ideas?

craggy needle
#

Hi, is there anyone who has experience with integrating SPH algorithm into unity? I'm mainly interested in the interaction of the partitions with the colliders. Thank you! 🙂

rustic raptor
#

I've got a player object with a rigidbody and the player's hands are connected via configurable joint. I get a lot of nice behaviour from the configurable joints however at moment the when the hands move they pull the player rigidbody along with it. I'd like to keep what I've got but add some kind of limit to the hands to say that if they try to pull away from the player then just stop moving the hand and don't pull the player along. All the settings I've looked at for the configurable joint don't seem to do this

jovial depot
serene wigeon
sick wharf
#

why do my wheel colliders do this do my wheel mesh?

#

nvm i figured it out

viral beacon
#

I have a situation where I have a chain of jointed rigidbodies, and for some reason at lower masses they perform awkwardly, but I don't want to make the object behave like its tremendously heavy, is there any way to artificially add mass?

stark pendant
#

hey everyone , did any one experiment with collisions events on articulation bodies ?

#

I'm having this weird error where the object Doesn't Trigger the OnCollsion Enter function if its a child or an articulation body , move the object from it's parent to makes the event trigger normally , any thoughts on this ?

#

I can see a similar issue here but it says it's Resolved (I'm Using 2020.3.43f)

timid dove
stark pendant
#

yeah

timid dove
#

Then that's expected behavior

#

each RB/AB forms a separate physics object. Collision messages only propagate within a single physics object

stark pendant
#

one of them isKienmatic

timid dove
#

regardless

stark pendant
#

so I should remove one's RB ?

timid dove
#

If the child is kinematic you may as well remove its RB

#

if the parent is kinematic and the child is dynamic then there's no reason to have a parent/child relationship in the first place

stark pendant
spare pewter
#

Ok, I'm running into a problem trying to calculate fall damage.

I'm trying to measure fallspeed (which works), and when it changes enough cause fall damage (which... kind of works).

I want damage to be based on fallspeed squared. (so falling twice as fast quadruples damage).

This works fine up to a certain speed, because the player speed goes to 0 immediately. (Say, from speed 8 to speed 0, for 64 damage)

However, when falling fast enough, the deceleration seems to take place over 2 (or more) frames. (Say, from Speed 9 to 3 in frame 1 (for 36 damage) and 3 to 0 in frame 2 (for another 9 damage), for a total of 45 damage).

Player physics material is default zeroFriction; changing the physics material of the impacted surface changes the exact numbers but not the general behavior. The Code is being run in FixedUpdate.

Is there a way to make deceleration a single frame, or to somehow keep a tally of the deceleration and tell when it's done or something? (to apply the damage using the sum of 'recent' deceleration)

I can't simply use OnCollisionEnter to get relative velocities, or (for instance), touching the wall of the inside of a cube would prevent damage when you hit the bottom.

cyan jay
#

Hello guys, im having a bit of a problem with my code. I posted it before in different channels, but then i found this channel. I deleted my messages before.
So now my problem is that i want to create a 2D game where you can grab stuff and play with them. I already tried a couple of solutions, but none really worked like i wanted it to work. In the video bellow you can see that it shouldnt behave like that, how can i fix it?

https://paste.ofcode.org/3bwvRDwaC6QpcZSwb9rpNyB

timid dove
#
  • make them out of multiple "primitive" colliders (boxes, capsules, spheres)
  • make a separate mesh for the collider only and use MeshCollider
#

just make GameObjects and attach the collider components to them

#

BoxCollider, SphereCollider, etc

#

as thick as you can

#

yeah bad idea

#

make it as thick as you can get away with

#

if it's like an external wall of the world with nothing on the other side, might as well make it 1m thick or larger

fiery ruin
#

Hi everyone....
Why my glider collider cross inside the box collider..
the mass of rigid body in glider weapon is 100 and is trigger is off..
other box collider side I use nav mesh agent to move to my charater destination

timid dove
fiery ruin
cyan jay
tight frost
#

I am using a polygon collider in order to make the walls of the room solid. I want to be able to track what room my player is in using colliders. However when i add a box collider (that should detect if the player is in the room), unity thinks that the box collider is a wall and i cannot move. How could i remedy this?

timid dove
tight frost
#

yeh thank you i just figured it out 2 seconds after posting this, XD

#

thanks anyway

fiery ruin
#

Hi everyone....
Why my glider collider cross inside the box collider..
the mass of rigid body in glider weapon is 100 and is trigger is off..
other box collider side I use nav mesh agent to move to my charater destination

cyan jay
spare pewter
#

Any tips for making clothing physics and moving platforms work together?

I can't get moving platforms to carry the player well when using rigidbody movement (Best I can manage is adding the platform's velocity to the player, but that doesn't account for rotating platforms, nor does it work well on ascending/descending platforms) but moving them through transform manipulation (unsurprisingly) makes the clothing components badly misbehave.

serene wigeon
serene wigeon
#

i dont think we ever got there

timid dove
#

I gave you a solution that would definitely work

#

¯_(ツ)_/¯

serene wigeon
#

which was?

#

the hand followers?

timid dove
#

yessir

serene wigeon
#

but as i showed you

#

the Spheres

#

dont they move via code since they arent parented with the controllers

#

or via physics you said i think

#

The whole "Gorilla Rig" is a public resource, i didnt make it

#

and i think what you were helping me with was getting me to realistic physics which isnt exactly how i wanted it

serene wigeon
#

?

serene wigeon
#

welp

fiery ruin
cyan jay
fiery ruin
spare pewter
#

I'll ask again, more simply this time:

Is there a way to get moving platforms to work with the Unity cloth component on a character riding the platforms?

The best I've managed so far is adding the platform's velocity (or getting it's deltaposition, then combining with Time.deltatime to get a velocity) to add to the player's. But that still causing the platforms to jitter and a lot of other behavior (especially with rotating platforms.)

wind meadow
#

question for colliders. If the parent object has a collider and it has a child that also has a collider, will functions like OnCollisionEnter on a script on the parent object also be called from the child collider ?

timid dove
#

Rigidbodies form the "unit" of a physical entity

#

if there's a Rigidbody, all colliders under it are part of that body and the object with the RB will receive messages for all of them

ember heath
#

Having this issue in 2022.2.1f1

wind meadow
#

but i call ontrigger from one of the children that has a box collider but not a rigidbody

timid dove
wind meadow
#

so still part of the physical entity you said

#

right my bad misuse of terminology

#

i meant declare ontrigger on the code

timid dove
wind meadow
#

got it thanks

tacit laurel
#

is there good looking fur in unity?

hushed salmon
#

it behaves weirdly with the character controller

#

should I use rigid body instead

#

the button sometimes comes off the base

timid dove
#

If you want physics to work you have to work with the physics engine

#

that means Rigidbodies and moving via Rigidbody methods

hushed salmon
#

so stuff like character controllers wont work when colliding with them

spice mirage
#

I have a question. I want to manually program some simple rigidbody physics instead of using the rigidbody system. Because I need to update it at around 2000hz which I can't seem to do using the built in physics engine.

Now, the main thing I need to achieve is how to properly simulate an offset force impulse and what the ratio of linear velocity and angular velocity should be based on the distance from center of mass.

From what I found so far, people claim that the linear result is the same in an offset impulse as a centered impulse. And that the angular velocity is then added on top. For example described here: https://www.gamedev.net/forums/topic/548752-physics-how-do-you-calculate-the-result-of-an-offset-force/

is this really accurate though? Wouldn't this add more resulting energy than you put in?

timid dove
#

The only things that are automatically physically simulated in the physics engine are Rigidbodies

timid dove
#

and using the physics engine as normal

spice mirage
#

i have not been successful in getting a high physics update frequency

timid dove
#

what have you tried

spice mirage
#

i tried changing some setting in the project settings (if i remember correctly) let me check what it was

#

but with that said, i would still like to program myself as I want bits of the physics such as collision detection to have a slower frequency

timid dove
#

what does "collision detection having slower frequency" even mean 🤔

spice mirage
#

yea, what i tried was to change the fixed timestep

#

under time

timid dove
#

ok and what happened when you did that?

spice mirage
spice mirage
#

i didnt notice any difference tbh

timid dove
#

then perhaps your issue has nothing to do with the simulation timestep

spice mirage
#

perhaps

timid dove
#

and you're chasing a red herring

spice mirage
#

that could be true

#

what is the default value for the timestep?

#

it was a while ago i tried this (running the physics faster) and i just decided to try this other approach now. that's why my memory is a bit fuzzy on some things 😄

spice mirage
#

i have it set to 0.005. but i will try to setup some experiments to figure out if it works

#

and get back

#

thanks for your help btw

spice mirage
#

yea sorry typo, i had it at 0.001, and idk if its 2000. but that's what i figured out i want now :)

#

thats only 1000hz

#

so i want it at 0.0005 then

unique cave
spice mirage
#

stability

#

i need a very light object to control a heavy object

#

if you keep increasing the forces, a light object will be come unstable and spazz out

#

unless you have a high simulation frequency

unique cave
#

Control in what way? Maybe there is a way to fake it

spice mirage
#

i dont want to fake it

#

i can say what im doing, im making a car driving simulation

#

the "fake" way to do it is to just raycast the ground

#

but it doesn't give as good results as if you simulate the whole thing properly with a high frequency

#

i basically want to have rigidbody wheel hubs which are constrained to the car body. the car body weighs over 1000kg, and the hubs weigh like 5kg

#

the hubs needs to be able to transfer forces in a very stiff manner

#

i have already looked at market examples of what I want to try my best to replicate as good as i can (for fun) and the good ones have one thing in common. 2000hz simulation speed

olive cedar
dapper wigeon
#

CALLING ALL PHYSICS ENGINE EXPERTS!

I have a surprisingly difficult challenge, trying to write an equation for calculating different results from the Unity physics engine.

Specifically I want to write an equation that calculates the distance travelled while decelerating from a start velocity, to a full stop.

The real life equation is this: DistanceTravelled = StartVelo^2 / (2*Deceleration)

But this equation does not directly apply to how Unity handles forces, velocity and distance.

An easy example to demonstrate the difference:
Imagine you have enough force to stop at next Unity FixedUpdate frame. Eventhough you had some velocity before the stop, Unity will register this frame as 0 distance travelled, since it first makes velocity 0, then calulates distance based on this new velocity. The real life physics equation would always give a value above 0 however.

I have made a public GSheet where you can try these results for your self. As you can see I'm comparing the actual results Unity will give (going through iterations), to different equations.
https://docs.google.com/spreadsheets/d/1QIqq0pHTVNwshf71KT73VzGMIIC4OI8t7LXyxx2-_OY/edit#gid=614627238

In certain cases none of my equations are 100% correct. Can anyone deduct the equation needed? Or at least answer if it is even possible?

(Attached image shows a screenshot from my GSheet)

Helpful tips will be rewarded! ❤️

jade crow
#

Hey! Is it a bad way to attach like 100 box colliders to one object?

dapper wigeon
#

100 colliders shouldnt be a problem for Unity, no

#

But it sounds like it could be solved more efficient nonetheless

jade crow
#

Do colliders occlude like textures when not facing camera?

dapper wigeon
#

No, all colliders must update regardless of scene view, unless you create a way around it

#

As always, you should include your actual use case, so that people better can help you with your problem...

jade crow
#

So I'm gonna paint procedural grass on a large area and that grass is used to hide player from enemy view.
So I'm currently placing collider in grass area so that when player gets inside collider, enemy won't be able to detect player.
Using this way I need to place multiple colliders.

#

I'm currently thinking of whether to use multiple objects (each object have collider to hide player) at each grass area or use a single object having all collider.
And will it be efficient?

dapper wigeon
#

I would just try to create 1 collider for the entire area

#

But having 100s colliders is no problem for Unity usually, if you can't manage to make only 1 for the entire area

timid dove
#

I'm not sure if it will cause problems for Unity's/Physx's spatial partitioning algorithm if the colliders are attached to the same GameObject or not

dapper wigeon
#

I don't think it will be a problem... Unity can handle multiple colliders, even of the same type, on the same object

craggy siren
#

I have a problem with joint in unity. Can someone help me to solve this?

#

When the joint is broken, other chains are spinning and flying away

timid dove
#

good luck

hollow apex
#

hey guys, everytime i hiy play my wheels move here and the car sinks in

dapper wigeon
#

xD

#

Go through all settings on the wheel components mb 😉

drifting sleet
sturdy tundra
#

Hi so I'm having a little trouble with my rigidbody, I'm trying to get it to slow down or break but it just keeps going

sturdy tundra
#

I press space bar to make it go and I tried ForceMode but its not exactly working out

daring furnace
sturdy tundra
daring furnace
#

And please just show the code in case there's missing context

sturdy tundra
#

The Angular drag is at 15, unless maybe its the mass? But I didn't change that

#

Also, no gravity

daring furnace
#

Code

#

And show the inspector

sturdy tundra
# daring furnace Code

🤨 But I just told you Im using AddForce and AddTorque...It's not like you need to see my Text functions

daring furnace
#

Why are you making this difficult

sturdy tundra
#

I'm not, you are

daring furnace
#

I said it's in case there's missing context

#

<@&502884371011731486>

#

So much for not looking to argue

sturdy tundra
#

:/ I didn't do anything wrong, I gave you the information

daring furnace
#

Needed more information. I'm stepping away from this

sturdy tundra
#

Ok

wide nebula
daring furnace
#

Also osteel, do let me know if this is an inappropriate reason to ping. They're not really breaking rules, but just not quite understanding how to get help

wide nebula
#

It's fine 👍

sturdy tundra
#

Its working fine, I just need to break

#

Im not having an error, I just want to add to it

daring furnace
#

Using add force usually allows things to slow down on their own. It's not in this case, hence why I want to see the code and inspector to look for something irregular..

wide nebula
#

If you want to slow down outside of increasing the drag, then you need to add force in the opposite direction to slow it down.

sturdy tundra
#

Ill give it a try

#

Wait

#

Angular drag or normal Drag?

wide nebula
#

Normal

sturdy tundra
#

Omg

#

Changing that to 1 worked lmao

#

Thanks

shrewd peak
#

Is there a way to tie physics to the framerate?

#

Im making a vr game and nomatter what i set the physics timestep too there always ends up being a very noticable stutter every second

#

The game wont actually use that much physics other then basic "I hit wall so i should bounce off" So am i better off writing my own simple physics solution to keep the graphics perfectly in sync with the physics?

timid dove
#

the simulation will become unstable otherwise

#

Typically if there's a stutter you're doing something else wrong though

#

first off, make sure you're using interpolation on your moving Rigidbodies

#

otherwise - you'll have to explain more about this "stutter" if we are to fix it

shrewd peak
#

I am using interpolation

#

The best way is like a jump

#
[|     ]
[ |    ]
[  |   ]
[    | ]
[     |]

Imagine this is the edge of a wall over time as my player is floating left

#

Its super smooth and just jumps

shrewd peak
timid dove
shrewd peak
#

Im not using any code

timid dove
#

but what are you using

#

you're talking about VR. Is the player attached to a dynamic body or something?

#

you'd have to explain the setup

#

the hierarchy

#

the components involved

#

etc

timid dove
shrewd peak
#

Its consistant in both editor and builds, and i can tell its not an actual frame drop in vr

timid dove
shrewd peak
#

Ive sinced closed unity but

Parent object with the XR Base stuff with the Rigid body
Sub object with XRCamera tracker

#

Thats it

#

And some small enviroment polys to actually see something

#

I can reopen it if needed

timid dove
#

that is quite an unusual setup

#

it also seems like... a recipe for motion sickness disaster 😵‍💫

shrewd peak
#

Well its a zeroG game

#

All of the players in it are coming from a zeroG vr game so motion sickness isnt an issue

errant gazelle
#

Some years ago I did a 2d project with a stickman that self balances, but as far as I can see there's no IK in my script, just a script that knows what the correct position of each bone should be like, and then tries to correct it each frame using a torque force on each joint (and to move it, I just move the body which has a joint to every limb of the stickman).. I don't know if I should go this route to make my new project, but their robot seems a lot harder to do than my stickman

dapper wigeon
#

Do you think the robot in the GIF is so physics-based that it would stand up if it fell over for example?

errant gazelle
#

Yeah (or at least it would try)

dapper wigeon
#

That's epic.. I would not know how to do that xD

errant gazelle
#

I don't know if the author has done something like this.. but he's the CEO of Landfall Games, he's famous for its physics based games

dapper wigeon
#

But please share if you find good answers

errant gazelle
#

In a comment he said Yeah! Rigidbodies + IK for legs

#

Mmh.. but I don't understand how to combine IK with rigidbody

hollow apex
#

hey guys, ive recently started this new project for a simple racing game, ive tried so many vids from yt an litterally copy pasta everything cause i could never get it to work and still it didnt work, now does anyone have any idea why and what the hell this is happening? If you could explain it aswell that would be highly appriciated so i can learn! :)

drifting sleet
#

using just game objects, colliders and rigidbodies

#

you can also use edy's vehicle physics or vehicle physics community edition for rigged vehicles along with all the other stuff you need

hollow apex
hollow apex
hollow apex