#⚛️┃physics

1 messages · Page 52 of 1

drifting sleet
#

oh

#

um

glass granite
#

so I iterate through all possible points

drifting sleet
#

that's a differently problem i think

#

i think there's a voronoi shatter plugin

#

you're looking for an effect called a voronoi shatter

glass granite
#

I need it to shatter in cubes

drifting sleet
#

yes, but people will have only written a high performance shatter for voronoi 🙂

#

i would start by looking at that, and then just making the adjustment you need

glass granite
#

it shatters in different pieces, not cubes

drifting sleet
#

oh no

#

i searched cube shatter unity3d, and a brackeys tutorial came up 😦

glass granite
#

thats what im talking about

#

but its only applicable for the Cube

#

so I basically need to see if any given point is inside a mesh, and if it is - create a voxel there

#

i just need a function that will return true or false and take Vector3 as an argument

#

where Vector3 is the point we're testing

#

Here is the iteration method

public void Recreate()
    {
        float voxelSize = 0.1f;
        var collider = gameObject.GetComponent<MeshCollider>();
        float height = (float)Math.Round(collider.bounds.size.y, 2);
        float width = (float)Math.Round(collider.bounds.size.x, 2);

        var startPoint = collider.bounds.min + new Vector3(voxelSize / 2, voxelSize / 2, voxelSize / 2);
        var direction = Vector3.forward;

        for (float z = 0; z < width; z += voxelSize)
        {
            for (float x = 0; x < width; x += voxelSize)
            {
                for (float y = 0; y < height; y += voxelSize)
                {
                    var testPoint = startPoint + new Vector3(x, y, z);

                    /// PSEUDO
                    /// 
                    /*
                     if (testPoint.isInsideMesh)
                     {
                         Instantiate(voxel, testPoint, Quaternion.identity, parent.transform)
                     }
                     */
                }
            }
        }
    }
#

Iteration itself works correctly when instantiating small cubes in each iterated point

frigid pier
#

If you have predictable voxel shape it becomes trivial to figure out that with math.

#

Other way you can do that is just split vertices of the shape into plane shapes, from there you can split them into squares and create voxels when they correspond with squares on the next level

#

Testing point inside simple geometric shape is much easier

glass granite
#

I tried to avoid messing with vertices and all this complicated (for me at least) geometry stuff, but looks like there is no other way for me

#

thought something like CheckSphere would work when completely inside a meshcollider

drifting sleet
#

i think you've figured it out

#

if the meshes are not dynamic, you can calculate ahead of time

#

navmesh and the lightning system both have features that require voxelizing geometry and spaces (negative and positive)

glass granite
#

will give it a shot, thanks

drifting sleet
#

if you want to hijack a technology those two may haev something you could use

glass granite
#

I did it!

#

Extremely messy but it works

#

Here's the code in case someone wants to improve it or just grab it

public bool CheckInside(Vector3 point)
    {
        Physics.queriesHitBackfaces = true;

        var ups = Physics.RaycastAll(point, Vector3.up, Mathf.Infinity);
        var fronts = Physics.RaycastAll(point, Vector3.forward, Mathf.Infinity);
        var rights = Physics.RaycastAll(point, Vector3.right, Mathf.Infinity);


        var downs = Physics.RaycastAll(point, Vector3.down, Mathf.Infinity);
        var backs = Physics.RaycastAll(point, Vector3.back, Mathf.Infinity);
        var lefts = Physics.RaycastAll(point, Vector3.left, Mathf.Infinity);

        Physics.queriesHitBackfaces = false;

        if (ups.Length > 0 && fronts.Length > 0 && rights.Length > 0 && downs.Length > 0 && backs.Length > 0 && lefts.Length > 0)
            return true;
        return false;
    }

frigid pier
#

"Extremely messy but it works" That's most of the games out there. Congrats 😄

glass granite
#

"If it works - don't touch it" --Socrates

frigid pier
#

And that includes AAA as well

glass granite
#

Is there a way to improve it?

frigid pier
#

With pure math it could be much neater, faster.

glass granite
#

Cool, thanks

#

Just noticed it could miss some small features 😦 but still ok, I guess

undone lynx
#

awesome!

glass granite
#

TY 🙂

umbral crow
#

hello! I'm having a problem with my physics materials. I have an object which I want to have no friction, and slow it down with a different script. I had this set up for months, and it's been fine. But now it's giving me an issue, where it seems like it has high friction, until i change the value on the file? gif attached to show what I mean

glass granite
#

Improved a bit. Instead of casting infinite rays that will hit other objects I limit them to collider bounding box

float height = (float)Math.Round(meshCollider.bounds.size.y, 2);
float width = (float)Math.Round(meshCollider.bounds.size.x, 2);

public bool CheckInside(Vector3 point, Vector3 startPoint)
    {
      //startPoint = meshCollider.bounds.min

        Physics.queriesHitBackfaces = true;

        float rayThreshold = 0.01f;
        float deltaX, deltaY, deltaZ;
        deltaX = (float)Math.Round(point.x - startPoint.x, 2);
        deltaY = (float)Math.Round(point.y - startPoint.y, 2);
        deltaZ = (float)Math.Round(point.z - startPoint.z, 2);

        var ups = Physics.RaycastAll(point, Vector3.up, height - deltaY + rayThreshold);
        var fronts = Physics.RaycastAll(point, Vector3.forward, width - deltaZ + rayThreshold);
        var rights = Physics.RaycastAll(point, Vector3.right, width - deltaX + rayThreshold);


        var downs = Physics.RaycastAll(point, Vector3.down, height - (height - deltaY) + rayThreshold);
        var backs = Physics.RaycastAll(point, Vector3.back, width - (width - deltaZ) + rayThreshold);
        var lefts = Physics.RaycastAll(point, Vector3.left, width - (width - deltaX) + rayThreshold);

        Physics.queriesHitBackfaces = false;

        if (ups.Length > 0 && fronts.Length > 0 && rights.Length > 0 && downs.Length > 0 && backs.Length > 0 && lefts.Length > 0)
            return true;
        return false;
    }
undone lynx
#

so i'm in a position where

#

i need to be constantly updating the rigidbody velocity myself

#

but i also need to be updating the object's transform

#

any way to make this all play along well without any jittering ?

#

managed to fix it i think -- i ended up updating rigidbody.position

#

and the jittering seemed to be because I was using transform.InverseTransformPoint(rigidbody.position

#

wanted to do the calculations in local space

#

however i think since transform was lagging behind a frame the inverse position was wrong

#

i switched to doing worldspace and it turns out fine

#

any idea if i could still do it in local space without jitter?

undone lynx
#

nevermind -- still got jitter

pure quest
#

does Overwatch engine have to use constant tick rate for physics or is it internally flexible?

#

in other words, - if the tick-rate slows down, does the game slow down as well?

undone lynx
#

im gonna leave some details here, in case anyone can help shed some light for me:

#
// Called if I am grounded, from within FixedUpdate
// Distance is the distance of the target point from the ground position (obtained via raycast)
if (!Mathf.Approximately(distance, _groundOffset))
  ApplyPositionSpring(distance);

...

private void ApplyPositionSpring(float currentDistance)
{
    var pos = transform.InverseTransformPoint(transform.position);
    var target = pos.y + (_groundOffset - currentDistance);

    var time = _slope < 0f ? _stats.UpSpringSmoothTime : _stats.DownSpringSmoothTime;

    pos.y = Mathf.SmoothDamp(pos.y, target, ref _springVel, time);
    transform.position = transform.TransformPoint(pos);
}
#

this is to keep an object off the ground a certain distance away from the ground position

#

the objects velocity is also set from fixed update (after this call occurs) and I update the rigidbody velocity directly in that function.

#

the issue is that jitter is caused due to the ApplyPositionSpring function

stable fog
#

How can I make a rigidbody always bounce back up to the height where it was dropped from?

#

so that it can stay bouncing forever

undone lynx
#

btw regarding my issue: i managed to apparently fix it disabling rigidbody interpolation, and resorting to using a constant time for my SmoothDamp

#

do ya reckon the smoothdamp issue is bc i am using one velocity for both spring times?

#

i also decreased the physics timestep to 60fps (0.01666)

#

but the smoothdamp seems to be the main culprit, and the interpolation was spazzing out probably because of unexpected transform changes

#

@stable fog i think you could try playing with physics materials on both the body and the surface

stable fog
#

I increased drag to 0.1

#

the problem is solved

autumn jetty
#

Trying my luck here as well, anyone could see the problem in this code? I'm not reaching the inner CastCollider, even thought I'm even now for debug purposes directly fetching the colliders from the trigger event and casting them?
https://pastebin.com/wFNKLiYn

autumn jetty
#

Answer: my input is in world space while it should be in collider space.

ivory crane
#

Hey guys. I've got a weird issue. I've got a player with a rigidbody that I'm applying my own gravity to, with gravity turned off. For now I'm just pulling them directly down but for some reason my character, after jumping, starts moving sideways.

#

If I disable my rotation lock you see that the character is trying to fall over, so I'm thinking it's something to do with that which is then translating into movement..

#

Wait, is it simply because the capsule collider is rounded at the bottom so it's trying to push down and move? ...

#

Nope. Same issue with a box collider.

stable fog
#

How can I increase a rigidbody's terminal velocity?

willow mural
#

How could I fix this issue please? I could reduce the character controller's size but then the hitbox would be smaller than the model

foggy rapids
#

change the position of the collider

willow mural
foggy rapids
#

then what is it that you want?

#

change the position/size of the collider until it encompasses your whole model

willow mural
#

I'd like it to be the size of the model but not so that it hangs to platforms like the 1st image

#

Maybe it's not possible with the character controller

foggy rapids
#

those are two separate issues

willow mural
#

That can't be fixed at the same time?

#

It s either one or the other?

foggy rapids
#

depends what you mean by "it hangs to platforms"

#

resizing the collider is the solution to the problem where the whole model is in the bottom hemisphere

willow mural
#

well that it looks anormal and floats in the air

foggy rapids
#

i have no idea what's normal for you

willow mural
#

not floating in the air

#

like the 1st picture

foggy rapids
#

that doesnt look like floating in the air

#

it looks like he's on the ground trying to eat that platform

willow mural
#

ah

#

sorry then

#

the ground is way underneath

proper urchin
#

hi, i'm trying to work with wheel colliders, and I was wondering if there was a way to control the wheels by velocity rather than acceleration?

hasty galleon
#

write an API that does the math and translates velocity to acceleration 😛

cloud sphinx
#

Quick question, what is the best method for a permanent pivot point? I tried attaching my object to a parent empty with a kinematic rigid body, I tried a bunch of combinations with colliders and rigid bodies and messing with the settings, but I need something stronger. I basically want to tether two objects together with a rope and make them impossible to detach

waxen edge
#

@cloud sphinx maybe joints can help you

pine helm
#

I am really confused. My addforce code only works when the "Scene View" tab is attached to the editor, but when I drag the tab to my second monitor, AddForce just stops working. Why is this?

#

does unity rely on the scene view for physics?

sacred briar
#

Hello guys ! I have a question.
I created an avatar and added cloth physics on it, I was wondering if there was a way to make the cloth collide with the mesh instead of creating a lot of capsule colliders ?
I have seen mesh collider but I don't think it is what i'm searching for.
Thanks for the help 😄

undone lynx
#

@sacred briar i think itd be best to use one or few capsules to do that

#

mesh collider wont update with animation unless you do it yourself

#

which would be very slow i think

#

capsules/spheres that best approximate the character shape would work well

undone lynx
#

@lime knot can u show the current setup

lime knot
#

sure

undone lynx
#

of your player, and your other object

lime knot
#

i just added the table and chair dont worry about them

undone lynx
#

so rn the player'

#

falls thru the ship?

#

can you select the ship object in your inspector, show me that

lime knot
#

sure

undone lynx
#

did u add the collider ?

lime knot
#

yep

#

i imported the 3d game kit which said it might change some settings

#

idk if that is why

undone lynx
#

can u check the convex option

lime knot
#

yea

undone lynx
#

there we go

#

it was bc the mesh is not concave prolly

#

i keep mixing those two up

lime knot
#

wait

#

that didn't fix it

undone lynx
#

can u show me the setup of your player object

lime knot
#

sure

undone lynx
#

whats that warning in your console

#

maybe the mesh is too complex

lime knot
#

yeah it is

undone lynx
#

i dont think a mesh collider works too well for objects with holes

lime knot
#

thing is

#

i made a cube earlier

#

i still fell trhoug that

#

even though it had a box collider

undone lynx
#

a box collider means your player would be inside the box

lime knot
#

wat

undone lynx
#

you need a box collider for the floor and walls

lime knot
#

ah

undone lynx
#

or a mesh collider would work for a cube

#

the specific shape youre using is probably the reason

lime knot
#

hmm

#

alright

#

i might change it the

#

n

foggy rapids
#

use a composite collider composed of several box colliders forming the outside of your donut

willow vortex
foggy rapids
#

vehicle physics are one of the hardest things to get right

worldly saffron
#

Hello everyone. I have a FirstPersonController which doesnt move with my boat. I think it's a problem with the CharacterController. How can I fix this?

foggy rapids
#

ur gonna have a bad time

willow vortex
#

the issue I had was it was totally broken, your example even with reset wheel collider settings (after unpacking prefab) still works just fine on the same terrain my other one just falls through and bounces off... O.o

#

I disabled scripts on both, reset wheel collider on both, parented them exactly the same, same rigidbody settings... and they act totally different 😦

willow vortex
#

would it be better to use a configurable joint for suspension and drive? 😆

foggy rapids
#

the more physical components you use the more complex it will be. The best is to directly represent a real physical car but that uses so many physical components it's almost impossible to simulate (in unity at least).
The key is getting the behavior you desire through creative means.

  • building your environment in a way that lets you make a simpler vehicle
  • fake the behavior without physics
  • etc...
simple walrus
#

my player sprite starts to drife after coming in contact with a collider on my map (2d) any help?

analog dagger
#

Hey, so this question is a little more general rather related to unity
How do collision systems function are they just simply checking the distance between two objects and checking if it is less than both objects width combined or is there more to it?
Sorry if this is a stupid question

foggy rapids
analog dagger
#

Thank you @foggy rapids

craggy grove
#

Hey I'm trying to understand Physics.CapsuleCast - does the maxDistance parameter really work like the Physics.Raycast maxDistance? I feel like it doesn't - when I have the maxDistance casting from a specific point, I get a much larger distance than expected...

craggy grove
#

Like, does the max Distance kinda dictate where the collider casts from?

white oracle
#

is there a way to slow down physics (slo-mo style) without slowing down everything else? i used Time.timeScale, but the problem is that it also slows down the playback on a Timeline that i'm using and I need the Timeline to play regular speed!

#

hehe never mind just found the "unscaled game time" option for Timeline's update method

craggy grove
#

...not to be that guy but

#

Anyone?

undone lynx
#

@craggy grove the shape casts cast their respective shape so

#

there might be a difference yes

#

how big of a difference are we talking?

craggy grove
#

Seems to be 5 meters or less... but kinda irritating. I'm trying to find something that would fit the width of a wide line that's rendered by a line renderer

#

For collisions

undone lynx
#

hmmm wdym?

#

5 units seems ... big

craggy grove
#

Well it's pretty noticeable I can say that much

undone lynx
#

hm... could you explain the scene a bit?

#

and what you are trying to accomplish

craggy grove
#

Here uploading screenshot

#

So I'm trying to get the thick invisible line (outlined in the dark blue border box) to create small line renderer "branches" that touch other cars in the thick line's vicinity. The idea is that, when the line or "laser" is small coming from the large vehicle, the line is pretty high since it comes from the middle of this large truck, so we want to make some smaller damaging hits, if you will, within a close radius of the smaller lasers as well

#

But problem is, as you can see, the cars are not in the range of that invisible line, YET there are small laser branches spawning to reach them

undone lynx
#

hmm i see

#

how are you calling the capsule cast btw

#

keep in mind

#

the positions you provide are the center of the capsule

craggy grove
#

Here's more of the expected behavior - the capsule cast has reached the cars

undone lynx
#

*sphere

#

can i see your capsulecast call?

#

have u tried settings the start center and the end center to the same value?

craggy grove
#
                            LineRenderer childTriggerLazor = lazer.transform.GetChild(0).GetComponent<LineRenderer>();
                            float capsuleTriggerLength = (childTriggerLazor.transform.TransformPoint(childTriggerLazor.GetPosition(2)) - childTriggerLazor.transform.TransformPoint(childTriggerLazor.GetPosition(0))).magnitude;
                            Debug.Log("Capsule length is " + capsuleTriggerLength + " and line length is " + lineLength);
                            RaycastHit[] childTriggerHits = Physics.CapsuleCastAll(childTriggerLazor.transform.TransformPoint(childTriggerLazor.GetPosition(0)), childTriggerLazor.transform.TransformPoint(childTriggerLazor.GetPosition(2)), childTriggerLazor.startWidth-2, transform.root.transform.forward, capsuleTriggerLength/2, -1, QueryTriggerInteraction.Ignore);
                            Debug.DrawLine(childTriggerLazor.transform.TransformPoint(childTriggerLazor.GetPosition(0)), childTriggerLazor.transform.TransformPoint(childTriggerLazor.GetPosition(2)), Color.red);
                            if (childTriggerHits.Length > 0)
                            {
                                Debug.Log("Can confirm branch trigger hits");

                                foreach(RaycastHit hit in childTriggerHits)
                                {
                                    Debug.Log("Checking hit for " + hit.transform.root.gameObject.name);```
undone lynx
#

so basically spherecast then

#

hmm so the positions

#

can u show me where those two positions might be?

#

in the scene

craggy grove
#

Sure

undone lynx
#

the input positions of the capsulecast

craggy grove
#

Ya here one sec

undone lynx
#

hmm might i suggest a small change that might help?

#

the capsulecasts maxdistance might be from either of the points -- i cant seem to find in docs which point, or if its a center

#

could you perhaps try using

#

a spherecastall instead

#

since your capsule moves straight forward anyways, its basically a spherecast

craggy grove
#

I didn't think it was a spherecast... but, maybe that's right

undone lynx
#

would be easier to find if its a bug or not that way

craggy grove
#

Wouldn't have occurred to me lol

#

I'd think there'd just be one sphere that's increasing in radius

undone lynx
#

it doesn't need to increase either

#

since your capsule is two spheres of equal length

#

*radius

#

casting that would be

#

the same as one sphere

#

capsule comes into play when u wanna for example horizontally raycast a capsule

craggy grove
#

So I'd be able to capture things in between two said spehere?

#

Well ya I do want to horizontally raycast

#

It's basically meant to be a super wide trigger laser

undone lynx
#

then you could simply arrange your points that way

#

get it?

#

instead of the capsule facing the truck

#

the capsule could be perpendicular

#

from the center

#

i think i should illustrate

#

to explain a bit better

craggy grove
#

Sure

undone lynx
#

sec

craggy grove
#

OK

undone lynx
#

excuse my ms paint

#

i didnt go to art school

craggy grove
#

lol it's fine

undone lynx
#

think of the black boxes as ur truck

#

first one is the capsulecast u are doing now

#

the green is the shape being cast

#

grey is the overall cast path

#

red is trajectory

#

second truck is one spherecast

#

its basically functionally the same as ur original capsule cast

#

the third one is what i meant by horizontal cast

#

and its a capsule cast

#

so i was asking u to perhaps try with a spherecastall

#

and see if it meets your needs

#

since a sphere is easier to position and handle the maximum travel distance

#

i think the bug is coming from the max distance being calculated for the capsulecast differently

craggy grove
#

Hmmmmm alright

#

I'll give that a go in a little while

#

Thanks man!

undone lynx
#

also to debug you can

#

draw a shape in your origin position

#

draw a ray of distance maxdistance towards the direction

#

and if theres a hit draw the shape at the hit distance

#

i do that myself a lot

craggy grove
#

I suppose I could try that, yea

proper urchin
#

concerning wheelcolliders, is there a way to get the true current rotation of the wheel?

#

of course i could have a variable and add wheel.rpm*Time.deltaTime, but I wondering if there was a way to get the current angular position of the wheel errorlessly

opaque cliff
#

Hey all, I'm following the Brakeys tutorial on FPS movement.

#

But I found that I am colliding with the PostProcessing volume near the middle of my scene.

#

IT is not on the same layer as my Ground objects so I'm a bit confused. :/

#

Seems I needed to set the Collider on the PostProcess to (isTrigger)

willow vortex
#

concerning wheelcolliders, is there a way to get the true current rotation of the wheel?
@proper urchin in the example linked by someone else they use: cs Vector3 pos; Quaternion rot; Collider.GetWorldPose(out pos, out rot)

soft ruin
#

does anyone here know about car tire physics?

#

i've experimented with a custom wheel collider for a while, but got stuck months ago and now decided to pick it up again

#

if anyone is familiar with the pacejka friction formula, i'd appreciate your help

stable fog
#

How can I increase an object's terminal velocity? (on the xz plane)

stable fog
#

Even when I set an object's mass to 0, it still falls. Why?

sharp ruin
#

Hi is there anyway that i can detect raycast hit which isn't in my layermask?

undone lynx
#

u can invert the layermask

#

i THINK you do it like this:

#

~layerMask

green hare
#

having a bit of trouble with jumping

#

when i'm not moving, my character jumps the normal height

#

but when i'm moving the jump height gets tripled

#
void Update() {
        direction = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));

        isGrounded = Physics2D.OverlapArea (new Vector2(transform.position.x - 0.5f, transform.position.y - 0.5f),
            new Vector2(transform.position.x + 0.5f, transform.position.y + 0.5f), groundLayer);
    }

    void moveCharacter(float horizontal) {
        rb.AddForce(Vector2.right * horizontal * moveSpeed);
        if (isGrounded) {
            animator.Play("runState");
        }

        if ((horizontal > 0 && !facingRight) || (horizontal < 0 && facingRight)) {
            Flip();
        }
        if (Mathf.Abs(rb.velocity.x) > maxSpeed) {
            rb.velocity = new Vector2(Mathf.Sign(rb.velocity.x) * maxSpeed, rb.velocity.y);
        }
    }

    void modifyPhysics() {
        bool changingDirections = (direction.x > 0 && rb.velocity.x < 0) || (direction.x < 0 && rb.velocity.x > 0);

        if (Mathf.Abs(direction.x) < 0.4f || changingDirections)
        {
            rb.drag = linearDrag;
        }
        else
        {
            rb.drag = 0f;
        }
    }

    void Flip() {
        facingRight = !facingRight;
        transform.rotation = Quaternion.Euler(0, facingRight ? 0 : 180, 0);
    }

}

#

here's the code

#

i can't really pinpoint whats making it do this

willow vortex
#

am I blind or did you not post the jumping code? 😛

river meteor
#

Hey I need to create a semisolid cream like physics. Like how toothpastes come out of the tubes.

undone lynx
#

sorry friend, i literally have not ever heard or seen that question asked

#

toothpaste physics

#

perhaps what u need is

#

soft body physics

#

fluid physics?

#

idk what it's exactly called

#

probably fluid physics, what ur looking for

green hare
#

my bad here's the updated version with the jumping code

#
void FixedUpdate() {
        moveCharacter(direction.x);
        modifyPhysics();

        //Jump
        if (Input.GetKey("space") && isGrounded) {
            rb.velocity = new Vector2(rb.velocity.x, 15);
            //Reference the animator tool
            animator.Play("jumpState");
        }

    }
void Update() {
        direction = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));

        isGrounded = Physics2D.OverlapArea (new Vector2(transform.position.x - 0.5f, transform.position.y - 0.5f),
            new Vector2(transform.position.x + 0.5f, transform.position.y + 0.5f), groundLayer);
    }

    void moveCharacter(float horizontal) {
        rb.AddForce(Vector2.right * horizontal * moveSpeed);
        if (isGrounded) {
            animator.Play("runState");
        }

        if ((horizontal > 0 && !facingRight) || (horizontal < 0 && facingRight)) {
            Flip();
        }
        if (Mathf.Abs(rb.velocity.x) > maxSpeed) {
            rb.velocity = new Vector2(Mathf.Sign(rb.velocity.x) * maxSpeed, rb.velocity.y);
        }
    }

    void modifyPhysics() {
        bool changingDirections = (direction.x > 0 && rb.velocity.x < 0) || (direction.x < 0 && rb.velocity.x > 0);

        if (Mathf.Abs(direction.x) < 0.4f || changingDirections)
        {
            rb.drag = linearDrag;
        }
        else
        {
            rb.drag = 0f;
        }
    }

    void Flip() {
        facingRight = !facingRight;
        transform.rotation = Quaternion.Euler(0, facingRight ? 0 : 180, 0);
    }

}

#

@willow vortex

undone kiln
#

hey people, how can I tell my collider not to collide with a specific thing

#

let's say, with a character controller's collider

fierce phoenix
bright nexus
#

Hey everyone, I'm trying to make a game and I need a 2d object to not move past a border. However I can't use a rigidbody in this case because it provides all those physics I don't need. How can I accomplish this?

hazy token
#

@undone kiln hey, you can use either Physics.IgnoreCollision or you can modify your collision matrix in project settings to choose which layers can collide with the player collider

subtle frost
#

my RaycastHit cannot detect moving objects though it detects the static ones. help please

viral ginkgo
#

@subtle frost Raycast wont detect backfaces by default
Are you perhaps starting the ray within an object?

subtle frost
#

I added box collider to the moving objects and it works now. But I don't get why, some of the static objects get detected even without it.

sharp ruin
#

i THINK you do it like this:
@undone lynx Thanks for your answer but i shouldn't have changed the layermask. But no matter i will find another solution.

old fiber
#

I've got a little ragdoll dude who works just fine. But, when I add an explosion force to him with rigidbody.AddExplosionForce, he absolutely turns to spaghetti. Like he gets all stretched out and his limbs fly everywhere before coming back together normally. Any idea why this is happening?

willow vortex
#

any way to reduce the ground magnetism that WheelCollider has?

pliant laurel
#

Hello, so I am trying to get my Player to collide with a Capture point

#

The easy way to do it is with a rigidbody

#

But I don't want my objects to have physics.

#

I tried RayCasting, I am pretty sure I did it wrong so I am looking for maybe a more easy solution.

#

Also yes I know my player model looks great

#

Actually wait nevermind I think I figured it out

pine helm
#

I've got a problem where I had the gravity level perfect, then I moved the rigidbody component above a script in the inspector to tidy up and the gravity now acts much lower. The problem is, I can't add more gravity or addforce won't work because the player is being pushed into the ground to hard. How do I fix this?

#

It's like the physic's engine has reset but kept certain value or something

#

I would appreciate an answer because it's kinda stuffing up my entire project

urban geyser
#

Hi, How could I change the velocity of a rigidbody using an Animationcurve ?

#

A distance/velocity curve

willow vortex
#

my 500kg trailer is pushing the rear 4 wheels with 30k spring/10k damping into the ground, what gives ? :/ the truck is 2000kg and works fine on its own

willow vortex
#

great, seems to have nothing to do with the constraint, the trailer here just sits on its own wheels being pulled by script forces to follow the truck, but whenever it's above the truck wheels they just glitch out and fall into the map 😐

#

yep, it's simply because the box collider is above it ¯_(ツ)_/¯

stable fog
#

When I turn around sharply, the ball turns not directly behind it, but curves around

#

I'm just using Unity's premade rollerball asset

#

rb.AddTorque(new Vector3(moveDirection.z, 0, -moveDirection.x)*realMovePower);

#
move = (v*camForward + h*cam.right).normalized;```
#

All other movement works perfectly fine, but this doesn't

stable fog
#

help?

fierce phoenix
#

Are you using wheel colliders or raycasts for the tire physics @willow vortex

willow vortex
#

@fierce phoenix wheel colliders, why? I mentioned the cause of my issue xD

south pecan
#

cant you just add a constant force componant?

#

oh its floating

exotic coyote
#

i tried that before

#

then it collides with the track and does weird stuff

south pecan
#

exactly

exotic coyote
#

So 2 constant forces pulling it up and down?

south pecan
#

it would have to be a balance and have trigger areas

#

and dampening so it doesnt just bounce lol

#

ive tried somthing similar in lumberyard but the physics are not so good in that

exotic coyote
#

how to do you dampen it?

south pecan
#

duno yet only just started learning unity engine today

exotic coyote
#

Oh XD

south pecan
#

well it has promise

stuck bay
#

I have an issue with my character controller, it sometimes lands on surfaces it shouldn't be able to land on, like very steep slopes etc (even though my max slope is 45 deg). And they don't fall off the steep slopes either, they just stay there and the controller can jump again

#

is there any guides for better character controllers?

fierce phoenix
#

@willow vortex I was wondering if the wheel raycasts were detecting the box above and deciding that the suspension was fully compressed.

willow vortex
#

yeah probably for either of them, I likely need to disable collision between those things; but I dunno why the visual wheels don't show as compressed in that case...

stuck bay
#

hey guys Im trying to get procedural animations done in unity and am struggling a lot. can anyone help or point me in the right direction

fierce phoenix
#

@willow vortex i think the wheels have a max travel, so they are popping to "max compression"?

viral ginkgo
#

@stuck bay get some free ik script and figure out ik target positions

#

you'll most likely be wanting to do the "figuring out ik target positions" in a coroutine

#

.
Can also use the animator's animation state scripts
To have it work nice and clean with the animator
That's what i'll try next if i get to doing some animation again

placid sail
#

Hi, sorry, but how do I connect my particle effects to my 2D collectable? I've been trying all day, but no dice.

steel pewter
#

@placid sail can you share what you have so far? in terms of hierarchy

placid sail
#

Nvm, fixed it. XD

stable fog
#

It seems like changing the mass of a rigidbody completely doesn't affect how fast it falls

#

ok, it's drag, i forgot

south pecan
#

why id unity ignoring offset with collision meshes

stuck bay
#

Question.

willow vortex
#

on wheelcollider again, it seems that any brake torque above 0 results in locking wheels upon braking... and doing ABS-style of braking makes it brake slower, apparently in nvidiaverse tire slip is more effective braking 😆

wooden hound
#

Would raycasts be a reasonable way of doing collision detection?

#

I am currently using OverlapBoxAll, which I suspect might be a bit slow

willow vortex
#

you can also have colliders with "IsTrigger" enabled to act as an area sensor

wooden hound
#

Would that be optimal for character movement @willow vortex ?

steel pewter
#

is there a discord for PuppetMaster?

young saffron
#

Anyone know how AI Navmeshagents deal with physics/what takes precedence between a navmeshagent and a rigidbody in terms of moving the object?

#

Would ideally love to set my AI truck to be moved purely by physics when a force "hits" it, but wondering if there's a cleaner way to do it than having to hard disable the navmeshagent or manually tell it that it just got hit by an explosion from the explosive creator.

tender gulch
#

@young saffron if the object, has a non kinematoc rigidbody, it will be affected by physics during the physics simulation, while the navmeshAgent will be moving it at it's own update, so you should disable one when you want the other to take precedence.

#

Ezpz OnColliderEnter call an event that would disable /stop movement from the navmeshAgent for some time.

river shuttle
#

It recognized it as C++

foggy rapids
#

use RayCastAll with no layermask to get an array of RayCastHit. iterate through those looking for the targets you're interested in

muted bobcat
#

Has anyone seen a large spike issue with spawning a few rigidbodies less then 100, unity physx.pxscontact.contactmanagerdiscreteupdate spike in profiler.

#

seems related to this https://issuetracker.unity3d.com/issues/physx-physx-dot-pxscontext-dot-contactmanagerdiscreteupdate-spikes-when-small-amount-of-rigidbodies-are-being-spawned and found someone talking about something similar related to not having vsync off. Tried that and did seem to "fix" it. Testing build to see if this is just an editor thing

foggy rapids
#

it has to check for collision after spawning to see if it spawned inside a collider.
Use an object pool

muted bobcat
#

hmm gotcha @foggy rapids usually do but had not wired that up yet. Good to know. Also had something to do with I had some old code that was setting them to CollisionDetectionMode.ContinuousSpeculative vs simply discrete. This was the bigger issues, setting it back to discrete seemed to "fix" the issue I was seeing even without pooling.

foggy rapids
#

sweet, other strategy i can suggest is to load over time. if you have 100, load 10 each frame for 10 frames

muted bobcat
#

yep another good idea. Using that with my pooling system should smooth everything out. Not sure why the CollisionDetectionMode.ContinuousSpeculative was soooo bad, perhaps that creates an even bigger issue with the spawning collision check. Also seemed like this was exponentially compounded with having a ton of other colliders in the scene (non rigid and non static). My guess is its related to a number of things at this point. CollisionDetectionMode.ContinuousSpeculative PLUS Lots of non static colliders in the scene with spawning (massive lag also happened when the object was destroyed btw so spawn in or out). Would need more testing to figure out exactly what is going on here. Curious if those other colliders where marked static if that would still have caused the issue.

#

Lots of variables here with lots of combinations to test.

full warren
#

Any one give me a hand. I have a grenade and i want it to ignore certain collisions so i set up a collision ignore in the OnCollisionEnter method that ignore the collision if it should but the grenade will bounce once and then ignore the collision it wont contiune to go threw the collider it has to hit it once first
Any ideas?

#

I did not create the grenade class im modifying it

#

Is it something to do with the rigidbody I'm new to unity stuff

long needle
#

Does anyone know why my FPS controller slips on moving objects?

paper slate
#

why wont this move when i collide with it
it has a rigid body and a collider

foggy rapids
#

it's too heavy

#

it's frozen

#

🤷

paper slate
#

mass is 1.0 and its not froze

#

it works if i make the collider bigger but than it floats

foggy rapids
#

then it's probably stuck in the terrain collider

arctic totem
river shuttle
#

I have this raycast code that is not working. Could anyone tell me what I'm doing wrong?

using UnityEngine;

public class RaycastManager : MonoBehaviour
{
    public DoorButtonPress doorButton;

    public AddBlackX addXButton;
    public AddBlackO addOButton;
    public SwitchColors switchColors;

    public float maxRaycastDistance = 10f;

    RaycastHit[] hits;

    void FixedUpdate()
    {
        hits = Physics.RaycastAll(Camera.main.transform.position, Camera.main.transform.TransformDirection(Vector3.forward), maxRaycastDistance);

        SendRaycast();
    }

    void SendRaycast()
    {
        for (int i = 0; i < hits.Length; i++)
        {
            RaycastHit hit = hits[i];

            if (hit.collider.tag == "DoorOpen")
            {
                doorButton.PressedDoorButton();
            }
            else
            {
                doorButton.OutOfRange();
            }

            if (hit.collider.tag == "AddX")
            {
                addXButton.AddXButtonPress();
            }
            else
            {
                addXButton.OutOfRange();
            }

            if (hit.collider.tag == "AddO")
            {
                addOButton.AddOButtonPress();
            }
            else
            {
                addOButton.OutOfRange();
            }

            if (hit.collider.tag == "Switch")
            {
                switchColors.SwitchColorsButton();
            }
            else
            {
                switchColors.OutOfRange();
            }
        }
    }
}```
#

Oh nevermind, it's working now

full warren
#

How do I disable collision between colliders by using the oncollision. Atm it will collide with the collider and then it will ignore. For example a ball must bounce once before it will fall threw the collider

arctic totem
#

@full warren have to write something custom that changes the collision layer after one bounce (FIrst hit collision layer vs second hit colision layer) or just turn the collider ball off on bounce 2

full warren
#

So do I need to use collision layers?

#

Essentially i want the ball to allways fall threw

#

But I wish to use the on collider event as it will be efficient for my use case

#

As of current say i drop the ball. It collides with the collider, phsyics.ignore runs on that collider and then the ball will fall threw

#

Does that make sense?

#

I guess my question is. Can i disable collisions between colliders when they hit each other or do i have to do it before they hit each other?

proven drum
#

Hey, I'm trying to do a simple mouse over detection on a tilemap generated through code. But I'm not getting any hit information with this: I'm using a raycast from camera to try and get hit info.

#

Is there something more I need to do to have the mesh be 'hittable'?

exotic coyote
#

Hey guys does anyone know how they did the gravity/magnetism in wipeout or f zero, trying to make a game like that and need help

tiny wedge
#

I don't know what is Wipeout but you can change gravity direction in unity

scenic kite
#

Hello I have two object use rigidbody2d I don't want object A to push object B while moving or vice versa

frigid pier
#

@scenic kite Don't cross-post , please.

mighty geyser
#

Does anyone know how effectors actually calculate the force they apply? I am using PointEffector2D as a gravity source. I would like to calculate the path that an object will follow. I am stuck at accurately predicting how the effectors will apply forces. Any ideas?

#

I'm looking for an equation that is, or approximates, how they apply forces.

chilly mist
#

Hi everyone ! I've been using Unity for the past 2 years to make 2D games, but now I'm trying to get into 3D, and the least we can say is that 3D can be ... hazardous

#

So I'm trying to make a simple rope, by joining small cylinders together with hinge joints, and...

#

It works "well" when there's only a few cylinders, although they don't really want to "stick" together when I turn the cube too much

#

And when there's "a lot" of cylinders, well ...

#

Let's just say that I could use a little help

#

Can anyone help me ?

unkempt vale
distant abyss
#

oh geez so you don't need to do a linecast but get the closest point OF a linecast? I have no idea how to do that

unkempt vale
#

@distant abyss Yep, it's a trollish situation. The only thing I could think of is subdividing the mesh (to keep some kind of accuracy of the calculation) I am testing against and the then simply checking projecting each point on the line segment, searching for one with the shortest distance.

#

But it doesn't sound very optimized. And it will require a lot of work across the board. I will have to weld the mesh vertices to optimize it even more, precalculate it all editor time etc.

distant abyss
#

I hope someone has a solution for you :x

still stone
undone lynx
#

@unkempt vale havent tested it but found this

thorn acorn
#

Hey, I have a capsule collider with a cube mesh renderer and mesh filter. Somehow when the player (a sphere with a box collider) the other object doesnt mover at all. The players mass is 4, the other object mass 1

wraith crown
#

hey - can anyone sanity-check my understanding?
If I have a propellor attached to a propellor (in air or water, only difference is the variables will go up or down etc)....

#

engine produces torque (with RPM calcualted based on teh torque curve of the engine)

#

propellor "recieves" that torque

#

and then decreases it in proportion to the force created at the prop to move the vehicle forward....right?

#

(or backwards or whatever - in the direction of the prop's output)

viral ginkgo
#

@wraith crown
you should probably have the relative water flow generate some counter torque on the propellor as well
(this is not friction, just waterflow acting on the propellor)

#

just for example why its necessary i think:

if the ship is statinory, it should be hard to run the propellor on high rpms so then you will have to gear down to have bigger torque on the proppellor coming from the engine

wraith crown
#

aaah, yeah

#

but in general my understanding holds up, yeah?

#

it's a block-based game, so the transmission lines could just have well have a wheel attached instead

#

so i want to make sure my "model" holds up for any usage cases the player might create

#

(I know wheel colliders will have to be dealt with separately)

viral ginkgo
#

@wraith crown yes

motor RPM curve + transmission level

wheel or proppellor RPM curve

#

simply put

wraith crown
#

my plan here is to have a "network" of nodes that connect producers (engines, electric motors etc)

#

and "consumers" (wheels, generators, propellors)

viral ginkgo
#

you'll be trying to find an end rpm curve

#

oh wait

wraith crown
#

so if they're linked together, i can add up all the consumers from the last fixedupdate

#

each "consumer" will obviously take some torque, and do something with it (e.g make electricity, dealt with in another network, or "AddForce" to the vehicle etc)

#

then the "pool" of all torque used can be calculated each fixedupdate...

#

and used to adjust the engine torque etc

#

that sound right?

viral ginkgo
#

But i wouldnt reccommend this because joints are springy and and more levels of chaining makes them even springier

wraith crown
#

yeah I won't do it physically; just the data model etc

#

gears I'll handle with a "gear block" so if you attach a gear block between an engine and wheel then it'll drop the torque but increase the RPM etc

#

or....

viral ginkgo
#

shared inertia is an issue
are you thinking about that?

wraith crown
#

not sure; i was thinking that if I calculate stuff like inertia at each "consumer" then it will take the right amount of torque from the network, even tho not all of it will be used for motion, some will be overcoming inertia

#

likewise gear boxes will change the RPM etc...and knock a little off for inefficiency

viral ginkgo
#

lets say your rotate one wheel externally via force
and because how they are connected, the wheel on the other side has to rotate the same way (assume differential locked)

this is a problem if you have this data graphs

wraith crown
#

wasn't planning on differential...

viral ginkgo
#

you need to have a global inertia and a global rpm

wraith crown
#

it is a building game etc, so not 100% realistic in every way etc..

#

plus players can add a wheel wherever they like...

#

what do you mean global RPM?

#

engine has an RPM, as a producer, based on it's torque curve

#

any consumers will then consume torque to do their thing (generte power, turn a wheel, a prop etc)

viral ginkgo
#

lets say you have a dynamo in the graph,
and it does globalRPM *= 0.97f every frame

wraith crown
#

and their RPM will be calculated on the RPM that their trnasmission recieves (which might be mdified by gears etc)

viral ginkgo
#

when engine stops, wheels stop
or the other way around

wraith crown
#

urgh my brain is melting

viral ginkgo
#

when one wheel stops, globalRPM is 0 so everything else stops im saying

#

if you could have that kind of system, things would be easy

wraith crown
#

right so, a graph; producers make torque (based on the RPM in their torque/rpm curve). Consumers, connected via transmission shafts, take torque from the "pool" of produced torque. They do something with it, which in turn affects the torque of the engine, which then drops RPM based on the torque used...

#

in the case of wheels, the wheel will have to overcome interia and friction to turn at the RPM it's recieving...

#

if the torque is sufficient for that, it will turn, decreasing the torque avaialble in the "pool"

#

what's the problem there?

#

i'm missing somethng aren't i?

viral ginkgo
#

if wheel has stopped it means the engine has stopped and engine torque curve is as zero

the vehicle is stalling
@wraith crown

wraith crown
#

that's...good

#

a clutch block would allow the engine to turn at it's idle RPM

viral ginkgo
#

yeah

wraith crown
#

whilst producing torque that doesn't get used

viral ginkgo
#

yep

wraith crown
#

clutch is 0-1

#

and a curve controls how much torque is released for each point on the clutch curve

#

is that right?

viral ginkgo
#

and engine inertia will also help when the clutch connects back

wraith crown
#

(stalling is part of the intended game play. They're designing a vehicle, it shouldn't "work" without effort)

#

what do I need to do with engine inertia...

viral ginkgo
#

for my game, for the clutch, i just multiplier the rotation joints force output

wraith crown
#

that's inertia that allows the flywheel to keep spinning for a small while even if the torque drops too low, right?

viral ginkgo
#

@wraith crown i wanted to make my game your way without joints
and i wanted use graphs like you do

but i couldnt figure it out
so i did it woth joints

#

@wraith crown yea

wraith crown
#

my only hard bit here

#

is how do I calculate the engine RPM

#

is it solely based on the torque curve?

#

(cos torque will drop as it's used by wheels, gnerators, props etc)

viral ginkgo
#

engine rpm could be the global rpm

#

i have to think and maybe come up with a complete system

wraith crown
#

OK so I calculate engine RPM based on the torque curve. The amount of torque is 100-0 based on the throttle

viral ginkgo
#

right now, i dont have a complete system if you have more than one source and consumer

wraith crown
#

and it will decrease based on the load placed on it by consumers eg whels or props

viral ginkgo
#

okay heres something

wraith crown
#

producers will all just feed into the "pool"

viral ginkgo
#

there will be no engine physically
and there wont be any states stored for engine n stuff

#

everytime, you will look at all consumers
and you will figure out a global rpm

#

engine will not have inertia, if you want extra inertia, you will define a dummy rotating body consumer @wraith crown

#

you will look at this calculated global rpm and run your rpm curve on that

#

.
and then you will obtain the engine torque

you will distribute it to global inertia
and depending on the gear ratios

wraith crown
#

hmmm

viral ginkgo
#

theres one last thing

#

any external forces must be reverted and re- distributed on the whole network
(distributed on global inertia and gear ratios again)

wraith crown
#

that was my plan - tho I hadn't considered a "global interia" idea, i'm not sure how/what that does

viral ginkgo
#

.
you'll be capturing these forces in OnCollisionStay, calculating the torque applied on object, reverting it and reappliying to network

wraith crown
#

i was looking at "torque" as basically just "mehanical power" which I know it's not

viral ginkgo
#

it can be very simple if you have one engine and one wheel

#

no need for all this

wraith crown
#

sadly, there could be unlimited engines and unlimited wheels, geenrators, props etc

#

well, not unlimited cos my building grid is limited in size

viral ginkgo
#

you just need
network.DistributeTorque(float torque)
this the main thing

#

you have this, %80 done

wraith crown
#

hah, i have it 80-90% planned in my head hahaa

#

so to summarise

#

network of produces and consumers; producers make torque based on their internal rpm curve, as a % of throttle.

viral ginkgo
#

difficult part is distributing torque based on both inertia and localRPMs(because of gearing ratios)

wraith crown
#

consumers use torque to do their "thing"; if it's a wheel for instance, the torque required to turn at the "transmission RPM" they get from the linking node might be more than is available, so it turns at a slower RPM

#

this slower RPM...erm

#

shit

viral ginkgo
#

doubling the localRPM by 2 probably is the same as doubling the inertia by 2
when it comes to distributing the torque btw

wraith crown
#

i think I'm getting tripped up on the inertia

viral ginkgo
#

you know what inertia is physically?

#

rotational inertia i mean

wraith crown
#

vaguely remember high school physics

#

i am 37

#

that was a lot of whisky ago.

#

intertia is the energy required to...

#

take the mass of the object and turn it or something

viral ginkgo
#

you need bigger force to rotate an object with same rpm if inertia is bigger

wraith crown
#

so i handle intertia at the consumer level; each consumer will have an inertia value based on it's cirucmstance (eg. one wheel might be on the ground but another is in the air)

viral ginkgo
#

@wraith crown a consumer should affect the rotation of a different consumer all the way across the network

#

only way to do that right and clean is
laying out some global values

#

and distributing the force on network

#

thats the best i can come up with

wraith crown
#

so

viral ginkgo
#

and there is still something missing from my model

wraith crown
#

wait, if the torque on a given consumer, lets say a wheel

#

is insufficient to turn at the current RPM it's been given

#

it will lessen it's local RPM

#

surely I cn just loop around all consumers and say "hey, what's the lowest RPM" (after correcting for gearing)

#

and then make that the global RPM

viral ginkgo
#

a wheel can be ahead of another wheel rotationwise after running for a while
i dont know how big of an issue it can make

wraith crown
#

think that would be a fair approximation tho? I just need a somewhat-realistic model that will work if i throw propellors, geenrators, etc at it

viral ginkgo
#

@wraith crown localRPM is always gearingRatio * globalRPM
and gearing ratio is kind of a constant

wraith crown
#

so if the local RPM drops, it drop sthe global RPM

viral ginkgo
#

@wraith crown its kind of hard to simulate in my head what this difference in phase

wraith crown
#

you've helped plenty, thank you.

#

it's my "understanding" of the basic physics and how best to "fake it" that's my sticking point etc

#

and you've helped a lot with that, so thanks 🙂

viral ginkgo
#

you know what, i think the phase difference is no issue

wraith crown
#

i'm not even sure what it is 😄

viral ginkgo
#

because only way you apply force to the system is this interface:
system.AddGlobalTorque(float)

#

@wraith crown i said that after running for a while, revolutions each wheel has made will be different even though they have same gearing ratios

wraith crown
#
        foreach (var producer in producers)
        {
            potentialProduction += producer.PotentialProduction();
        }``` is what I am using in the electrical grid code
#

that woudn't matter, as long as the rpm s equal etc

viral ginkgo
#

this one we are talking about is different animal tho

#

you wont have stalling like we have here with that option

wraith crown
#

should do

viral ginkgo
#

you apply big force to stop one wheel
will the other wheel stop as well in single frame?

wraith crown
#

the pool has, say, 200 torque, yielding 1800RPM. wheel needs 180 to overcome it's inertia, then 20 to turn but the RPM is waaay down now below the stall level of the egnine, engine stalls

viral ginkgo
#

you shpuld be able to do differential lock like connections for starters and then move on to different things i mena

wraith crown
#

hmm clutches are an issue tho

#

if a clutch block is in a network,

viral ginkgo
#

i was thinking a clutch node will split the graph into two graphs

wraith crown
#

it should stop transmission of 0-1 torque

viral ginkgo
#

at will

wraith crown
#

no cos a clutch isn't 0/1, it's 0-1

viral ginkgo
#

when clutch is %100 connected, graphs are merged again

#

or just do the math so it would behave the same i mean

#

keeping the graphs disconnected at clutch node permenently

wraith crown
#

aah

viral ginkgo
#

clutch will be like a source and consumer at the same time

#

whichever part of the graph has bigger globalRPM, applies negative torque

whichever part has smaller globalRPM, applies positive torque

#

based on difference in globalRPMs

#

wait that should depend on inertia as well

wraith crown
#

it's not too simple is i

viral ginkgo
#

this itself could do but with inertia it would be more accurate

wraith crown
#

but yeah, clutches split network

viral ginkgo
#

and you'd be able to make solid connection

#

as if the network wasnt split at all

wraith crown
#

or,,,

#

... even

#

clutches make every item "down" from them

#

a sub-network

#

with it's own RPM and torque calcs

viral ginkgo
#

sounds same as splitting the network with extra refactoring steps

#

can do

little fulcrum
#

Hi, I'm working on a marching cubes terrain system in Unity, and I've come to the physics part and I'm unsure as to how to approach it. The method I think will be most effective would be to take the mesh, use a decompose algorithm on it to produce convex mesh(es) from the terrain mesh, then feed these into mesh colliders. However I'm unsure as to whether it will incur bad performance. Can anyone offer any guidance? Thank you!

wraith crown
#

cos then the "network" is set when they finish building the vehicle and can't be changed etc on the fly..

craggy shoal
#

having an issue with boxcasts

#

bool temp = Physics.BoxCast(Vector3.back * 15, bounds.extents, new Vector3(x, y, 15), out hit, obstacle.transform.rotation, 1000);

#

has temp = false when I visually can check that there should be a collision

viral ginkgo
#

@little fulcrum you can have nonconvex mesh if the object is not dynamic rigidbody
so just slap the marching cubes mesh on the collider

little fulcrum
#

I'm using a rigidbody for my player and I'd like the player to be able to collide with the terrain

viral ginkgo
#

fine

little fulcrum
#

Unless I don't need to use a rigidbody. I'm extremely new to Unity

viral ginkgo
#

have the terrain as just collider and visual stuff

#

no rigidbody

#

have rigidbody on player or other stuff

#

you'll be good to go

little fulcrum
#

There's no rigidbody on the terrain, the player does have one and it passes right through the terrain with a standard mesh collider

viral ginkgo
#

@little fulcrum you probably didnt set the sharedmesh field in mesh collider of the terrain

little fulcrum
#

I have done so

#

ignore convex, that was for testing

#

convex does work, but as you can imagine its unusable

viral ginkgo
#

make convex false

#

k

#

the mesh is not convex so dont set it convex

#

and it does not need to be convex

#

pause the unity when game runs, take a look at the terrain mesh

little fulcrum
#

okay, very strange. If I disable and enable it in the inspector when running it works

viral ginkgo
#

click on the mesh field of the collider

little fulcrum
viral ginkgo
#

@little fulcrum thats the right mesh right?

little fulcrum
#

yea

#

The same one being rendered

#

Collisions work perfectly after toggling them in the inspector. Once I configure the mesh am I supposed to call something or update the sharedmesh reference?

viral ginkgo
#

maybe restart unity

little fulcrum
#

I've restarted countless times during this lol

#

because I set the mesh (I think its a reference) then set its vertices etc.

viral ginkgo
#

try copying maybe

#

i dunno really

little fulcrum
#

I'll try updating sharedmesh to see

viral ginkgo
#

id think its already copied anyways

little fulcrum
#

That worked, setting it after configuring the mesh

viral ginkgo
#

maybe theres something like collider.updatemesh or something

#

hmm interesting

little fulcrum
#

yeah, no methods on it like that, but this seems to work fine lol

#

maybe it is copying for safety?

viral ginkgo
#

does it have like a simple value icon

#

or is it a getter/setter type of thing

little fulcrum
#

it is a property

viral ginkgo
#

its probably a getter/setter

little fulcrum
#

Yeah, it is

viral ginkgo
#

with wrench icon i mean

#

then its basicly a function

#

must be copying it
i never had to make a copy of the mesh

little fulcrum
#

huh, oh well, at least it's working as intended now (and I've not wasted countless hours implementing a decomposer). Thank you for your help!

viral ginkgo
#

np

craggy shoal
#

figured it out, was moving colliders in the same timestep

shut wind
#

Is there anyway to remove wheel collider suspension withotu causing chattering of the vehicle and other weird behaviour?

slim olive
#

would a hinge joint be the best way to do this?

fierce phoenix
#

@slim olive that will probably work. Or use a spring joint.

craggy shoal
#

could be easier to control the player velocity in-script

#

would be more predictable than a joint

sharp ruin
#

Is it possible to disable collisions between childs of two seperate parents in a 2D game?

viral ginkgo
#

@sharp ruin you could just use the collision layers

#

@sharp ruin if you are fine with 3d physics just move them in z axis and lock x,y rot and z pos

#

if you wanna get real fancy, try to see if you can get the objects in seperate physics scenes

sharp ruin
#

do you think 3d components like rigidbody, collider dont make any problems in 2d game? I mean, are there any games using this type of convention. This is my first product-level trying so I dont know that much of its practices. And... We use tilemap-2d. Interacting 3d objects like rigidbody and collider with 2d-tile map makes me think that this might cause a problem in the future?

foggy rapids
#

there are many

viral ginkgo
#

@sharp ruin i'd try to have the 2d phyiscs if i have more than 20 moving at a time and if its a mobile game

#

@sharp ruin you know how collision layers work?

its probably what you want

sharp ruin
#

its a 2d desktop platformer game.what we really want to do is creating 3 different "dimensions" back to back shown below and we dont want interact any of the objects in one "dimension" with the objects in rest of the "dimensions". we only want to render objects of the dimension that the main character is in whereas the objects in all dimensions keep moving and interacting as they did. and we dont want to disable collisions based on layers(as dimension1, dimension2, dimension3) because we have different layers for every different type of object @viral ginkgo

viral ginkgo
#

@sharp ruin if its going to be just 3 layers like that, just switch between the 3 collision layers

sharp ruin
#

Are collisions layers something different than layers?

viral ginkgo
#

its the same

#

its what you see in the top right of the inspector

sharp ruin
#

But all of the child objects have their own layer like Player, tile etc.

viral ginkgo
#

and in collision matrix, you'll do adjustments to prevent 8ntercollision between these layers

#

@sharp ruin you will make sure all those child objects of the same parent belongs to to the same layer

#

dont do the parenting if you want

#

not necessary

#

you have to make sure each child object have their layers correct

sharp ruin
#

I see your point but I dont think it works. Here is why: We dont want to disable collisions in different dimensions based on layers because we have already different layers for every different object in our game such as bot1, tile1, tile2, player, ... etc for other purposes. Besides, if we narrow layers down to three, this will make us not taking advantage of layer based collisions for other purposes

viral ginkgo
#

yes, that will prevent you from using the layers for other purposes

#

you could consider switching physics scenes then

sharp ruin
#

can you provide some documents to learn more about physics scenes

viral ginkgo
#

@sharp ruin it might be easier to just use different scenes

#

but if you have two different running at the same time, i believe they will use the same physics scene by default

#

so you will need to instantiate and assogn a new physics scene for each scene

#

i messed with these before
but i dont remember where i got the info from

sharp ruin
#

I will check thanks for your time

void grotto
#

I would like to work on a game involving collisions between many fast-moving small lightweight objects sliding along a surface. Think Marbles, or Air Hockey. Would Rigidbody Physics be able to handle this sort of thing, or does the collision system break down at those levels of precision? Are there any other physics system Assets anyone might recommend for something like this if Unity's built in physics aren't up to the task?

foggy rapids
#

many fast moving objects colliding with eachother isn't something PhysX does particularily well. Try t out and see, but you'll most likely switch to bullet or something

void grotto
#

PhysX is Unitys out of the box physics engine, right? Or do I need to grab an asset or something for that?

foggy rapids
#

it's out of the box yes

void grotto
#

And where can I find Bullet? Looking for "bullet physics engine" just brings up like, physics for bullets. Is it a different engine?

foggy rapids
void grotto
#

Cool beans, I'll give that a go

foggy rapids
#

or make your own physics.
I find that physx either does way more than you need, or fails in the particular aspect that's important for you

void grotto
#

Until now I've done my own physics and collisions, but for this project I kinda want realistic bounces, impulses, and ricochets and I feel like this is literally what physics engines are built for

broken frost
#

For my main movement I am trying to have a player rotate around the center point of a disc.
Moving left should rotate clockwise around the surface of the disc, moving right should rotate counterclockwise.
The y rotation of the player starts at 0, at the location [0,0,-48000], and as I rotate around the origin point of [0,0,0] that rotation of y axis changes accordingly, however when I attempt to return to my spawn position [0,0,-48000], where I expect to see rotation of y axis to return to zero, it is a different value other than zero.
What is happening with this rotation?

urban geyser
#

Hey can anyone tell me which unit is the weight of a rigidbody ?

fierce phoenix
#

@urban geyser kilograms. Those values make sense if your distance/scale is that 1 unity unit = 1 meter

urban geyser
#

thank you

stuck bay
#

ok i think this is the right place (i think) So im tryng to replicate savavs parkour mod from gmod (Link Below) and id like to ask which would be the best thing to use:

Character Controller Or RigidBody

and also can you provide a link to help me make one of these

https://www.youtube.com/watch?v=TxubrgxD4OU

(i dont need the gun just camera movement and detecting walls)

stuck bay
#

i need dampening to be 1000 AND for vehicle to be movable both at same time

viral ginkgo
#

@stuck bay maybe your tank is too THICC

stuck bay
#

?

viral ginkgo
#

compared to the rigidbodies that have the wheels

stuck bay
#

its 1000 mass

viral ginkgo
#

what about the wheel objects?

stuck bay
#

wheel mass is absolute minimum possible

#

like 0.0001 or something

viral ginkgo
#

I think if you shifted some of the weight the wheel objects, it should be fine

foggy rapids
#

how are they not flying off of your tank

viral ginkgo
#

Make body 200, wheels 50 each

#

or something like that

#

Or, attach the wheels on the 1000M body directly

stuck bay
#

at first i wanna test with 10

#

oh... i never thought of that tho

foggy rapids
#

the force required to keep your tank from crushing your wheels is probably larger than any force the wheels are generating

viral ginkgo
#

@stuck bay Joint strenght seems to depend on the mass of the object its attached on, for all kinds of joints

stuck bay
#

i made each wheel weight 1000, still doesnt want to move

#

force is tilting the object, but cant move it

viral ginkgo
#

just set everythings mass to 1
try to have default values in spring, dampening and stuff

#

when you get it right, multiply everything by 1000 or something

stuck bay
#

they do work on default, but theyre static af, the tank has no acceleration movement

viral ginkgo
#

then more motor force

stuck bay
#

it doesnt lean forwards/backwards

#

Im applying regular acceleration force

viral ginkgo
#

@stuck bay on wheels right?

#

as torque

#

or motor

stuck bay
#

if i set springs to 10 000 and dampening to 10 000 with wheel mass 1 it moves. but thats 10x as much dampening as i need

#

No. Im applying it to the tank.

#

Wheel colliders serve as suspension only

viral ginkgo
#

@stuck bay you are doing addforce on the tank??

stuck bay
#

yes

viral ginkgo
#

hm, why not use the wheel motors

#

it will not be the same you know

stuck bay
#

can i tell them to accelerate 10m/s, decelerate by that etc?

viral ginkgo
#

you are just applying linear force at the center of mass and expecting the object to tilt
@stuck bay

stuck bay
#

no, im expecting the object to move.

#

The object moves, if the suspension is ridicilously high

#

but i dont want it to be high

viral ginkgo
#

At least you can just apply the force from below the center of mass
AddForceAtPosition(yourForce, transform.position + Vector3.down * 2);

stuck bay
#

for what effect?

viral ginkgo
#

@stuck bay it will push the tank from bottoms and give you what you want

#

but its not the correct way

#

just so you see what i mean

#

you get your wheel motors right, and you will have your tilt, and dont do the addforce

stuck bay
#

i cant set it to drive in certain speed

#

so i kinda have to use force

viral ginkgo
#

you should be able to

#

if you had some drag or friction in wheels

#

i never used those wheels before but there has to be that kind of stuff

stuck bay
#

i looked at wheel scripting api, it has nothing about accelerations etc

viral ginkgo
#

it should have "motor" stuff i think

stuck bay
viral ginkgo
#

no

#

whats the code that applies force

#

you replace that line with this:
"AddForceAtPosition(yourForce, transform.position + Vector3.down * 2);"

stuck bay
#

there is motor torque, but i dont have any idea what it is and it doesnt have values for acceleration etc

viral ginkgo
#

and your tank will tilt

stuck bay
#

im using the wheels to suspend my tank a lil bit above the ground as well

viral ginkgo
#

@stuck bay Use Motor, motor speed and max motor force

#

that stuff

#

if you will use the motors forget this:
"AddForceAtPosition(yourForce, transform.position + Vector3.down * 2);"

stuck bay
#

im on 3d, not 2d

viral ginkgo
#

@stuck bay oh wait

#

you dont even have wheels

#

rotating kind i mean

stuck bay
#

yes

viral ginkgo
#

wheel colliders and configurable joints maybe

stuck bay
#

i have wheel colliders

viral ginkgo
#

what joint are they connected with?

stuck bay
#

none

#

theyre in hierarchy

viral ginkgo
#

they should be connected to the tank with joints

stuck bay
#

why?

viral ginkgo
#

and you should be applying rotational force to rotate them

#

or use joint motors

#

if you want to do that with wheels

stuck bay
#

i dont. Wheels have suspension, therefore im using wheels

viral ginkgo
#

or you'll just do some custom code in OnCollisionStay
And simulate what a rotating wheel would do

stuck bay
#

The only thing wheels do is provide me with suspesion

viral ginkgo
#

or you'll just do some custom code in OnCollisionStay
And simulate what a rotating wheel would do
@viral ginkgo
Then this is what you can do

#

Looking at relative speed to the ground, applying forces

stuck bay
#

but im not using a single rotating wheel, neither i need to.

#

i press W, object moves forwards.

#

Simple

#

no massive torque calculations for acceleration or whatever.

viral ginkgo
#

or you'll just do some custom code in OnCollisionStay
And simulate what a rotating wheel would do
For this, you dont need rotating wheel
But if theres a force or friction apply, you should do it by the wheels
Do grounded check in wheels, figure the force from the wheels relative speed to the ground

stuck bay
#

and i have tank physics maker asset which is based on torques etc, and its doing the job i need really badly.

viral ginkgo
#

By wheel, i just mean that non rotating thing you have under your tank

stuck bay
#

for example, i have a hull which needs to be with 1100 mass and it needs to move 13 m/s. With that asset i need to make each wheel 2500kg and its still barely reaching 12.5 m/s

#

Thats why i dont want to use it

viral ginkgo
#

.
Or heres the simplest thing i can come up with
1- You do grounded check and then apply your force

2- You prevent velocity that is perpendicular to the tank.forward

3- You apply the forces from bottom of the tank via calling AddForceAtPosition on the tank instead of calling AddForce (this is just to archive that realistic tilt you want)

#

@stuck bay

#

Other then these, you keep the setup same

stuck bay
#

im already checking for ground. Red gizmo cubes meant that it doesnt detect ground, yellow means that no suspension is active, but tank can already drive, green means the tank is fully on ground

viral ginkgo
#

@stuck bay then you have 2 and 3 missing

stuck bay
#

yeah. i dont rly know how to do 2 and 3 made my tank bounce

viral ginkgo
#

If you did all this per wheel collider thing, you will have better realism
You could also multiply the wheel force with suspension tension

#

@stuck bay you did the 3 wrong

#

yourforce is the driving force

#

not some weird upward force

stuck bay
viral ginkgo
#

3 will do it @stuck bay

#

give me the line

stuck bay
#

that line is long gone for bouncy tank

viral ginkgo
#

that particular line of code that is responsible of moving the tank

#

give me the line that is reponsible for moving your tank you are using right now

#

`

stuck bay
#

thisRigidbody.AddForceAtPosition(transform.forward * stats.Acceleration * ((1f / trackCastRight.Length) * (activeRightTrackPoints)), trackCastRight[2].position, ForceMode.Acceleration);

viral ginkgo
#

and cs

stuck bay
#

there are massive chunks of code commented out. Those are my previous far more complicated unsuccessful attempts

viral ginkgo
#
thisRigidbody.AddForceAtPosition(transform.forward * stats.Acceleration * ((1f / trackCastRight.Length) * (activeRightTrackPoints)), thisRigidbody.transform.position - thisRigidbody.transform.up * 3f, ForceMode.Acceleration);
#

fixed something

#

copy now

#

replace that line

#

with my code

stuck bay
#

thisRigidbody is... this rigidbody.
stats.Acceleration = 10
trackCastRight/Left = how many cubes in each side
ActiveTrackPoints = how many of those cubes are touching ground

#

oke changing

viral ginkgo
#

@stuck bay i just looked at the code
i was expecting one force

#

found one force per wheel thing

stuck bay
#

well, force for each track.

viral ginkgo
#

each track that is grounded?

stuck bay
#

no. Each track has 5 points represented by cubes.

#

if all 5 cubes are on ground, the track is accelerated by 100% speed

viral ginkgo
#

doesnt matter at all anyways

stuck bay
#

if 1 cube is on the ground, the track is accelerated by 0.2% speed

viral ginkgo
#

@stuck bay the version you sent me now should be giving you the effect

#

maybe suspensions are stiff

#

if not

#

then you could try this for each of those forces

stuck bay
#

i did add ur code, yeah, i need to adjust the values, cause it was trying to flip the tank, but yeah XD

viral ginkgo
#

flips it the correct way? @stuck bay

#

my code will basicly move the force a little lower

#

to boost the tilt

#

the force will come below the wheel

stuck bay
#

yeah, it did flip it the correct way, but too much

viral ginkgo
#

i see

#

can make that 1 instead of 3

#

or 0.5f

stuck bay
#

1 didnt do much, so i made it 2f

#

ill make it 1.75f

viral ginkgo
#

@stuck bay if you check each wheel for grounded and apply force depending on that, it will be more realistic and wont flip

#

even with 3

#

because if the tank starts flipping, only the most backwards wheels will generate force

stuck bay
#

i am checking for each grounded wheels

viral ginkgo
#

but force has 1 multiplier for all wheels

stuck bay
#

And i am applying acceleration based on how many wheels are grounded

#

can i apply acceleration multiple times per update?

viral ginkgo
#

accelaration should be same as force

#

force * mass even

stuck bay
#

if each wheel accelerates object by 1 m/s, and all 10 are on ground, will it be accelerated by 10 m/s?

viral ginkgo
#

no

stuck bay
#

then that doesnt fit my needs

viral ginkgo
#

acceleration mode will just apply the force to make that object accelerate at given value in empty space with no gravity

#

its just a force

#

with mass as a multiplier

stuck bay
#

even my current system doesnt fit the needs, because it can reach speeds beyond maximum speed

viral ginkgo
#

@stuck bay you need friction in wheel areas

#

make it part 4

stuck bay
#

yeah, i know. And i got no idea on how to get excatly precise coeff to get it

#

i have js code for suspension etc, but i got no idea what any of it means.

viral ginkgo
#

frictionForce = Vector3.Project(relativeVelocity * -0.1f, groundNormal);

stuck bay
#

and how is that going to limit my speed to 10 m/s?

viral ginkgo
#

force is same, friction increases linearly with velocity

#

this effectively gives you a max velocity

stuck bay
#

so i add this code to each wheel?

viral ginkgo
#

yea

#

relative vel wont change much per wheel

#

doesnt matter much

#

but since you add the forces per wheel, might as well do this per wheel

#

.
i have some assignment i should get back on good luck

stuck bay
#

oke, thanks.

#

cya

viral ginkgo
stuck bay
#

xd

stuck bay
#

@viral ginkgo wheel colliders have their own suspension so i don't get why they need joints as well.

viral ginkgo
#

@stuck bay dont worry about that, it was for archieving rotation on the wheels
but we decided not to use rotating wheels

stuck bay
#

for visual wheels there is a function for that

viral ginkgo
#

this was for physics part

#

i offered the rotating wheels for accurate physics

#

but that may not be the best way

stuck bay
#

limiting your speed however is just this

if rigidbody velocity.magnitude > maxspeed dont apply torque to wheels on this current frame.
viral ginkgo
#

i thought thats not very natural

#

here an example:
you speed up the tank, below the max speed
and stop pressing W
tank will glide forever on flat road

#

this could go together with what i offered tho

stuck bay
#

you can also scale torque based on speed

var linear = 1.0 - clamp01(velocity / maxspeed).
wheel.torque = maxtorque * linear.

^ apply less torque at max speed.

If you want to decelerate without breaking - you can apply a little bit of reverse torque

#

but also have drag on rigidbody

viral ginkgo
#

@stuck bay theres no rotating wheel, therefore no wheel torque

#

only linear forces at wheel positions

stuck bay
#

so he isnt applying power through the wheel colliders?

#

ihave a code which checks if the tank is moving faster than maximum speed, it decelerates the speed

#

no.

#

I used wheel colliders purely for suspension

viral ginkgo
#

@stuck bay just linear force, no actually physically rotating wheels

stuck bay
#

error = currentspeed - desired speed
rb.addforce(error * scale)

#

something like that then

#

that would be kinda suddent drop in the speed

viral ginkgo
#

same as what i offered in practise but desired velocity is 0
@stuck bay

stuck bay
#

if desired velocity is 0 then error is actually inverse of your current velocity

viral ginkgo
#

yes

stuck bay
#

so all you need is to scale it and apply it

viral ginkgo
#

this is just modelling friction

#

not like max speed or anything

#

max speed comes natually

#

.
because friction increases linearly as velocity increases
and forward force is always same

imagine the graph (force/velocity graph), a flatline and a diagonal line
the point they intersect is the max speed

stuck bay
#

but when desired speed and current speed intersect your error is zero - which is the point where you are traveling at max speed until you set a lower desired velocity.
So there is a point somwhere I am missing?

#

yeah, but i tried the line, rigidbody.material.dynamicFriction can be only float, not vector3

viral ginkgo
#

@stuck bay yes
if you are at 0 velocity, it will try to speed up

#

and this is for friction

#

you mean this is just for controlling velocity?

#

then can work

#

pretty much same effects as when you do "force + friction" in my model
because the friction is linear

stuck bay
#

I don;t know if im the confused one or not but the error would be used in both accell and decel.

viral ginkgo
#

I see

#

Its pretty much same as what im doing when you combine the friction and force in my model as i said

stuck bay
#

idk

#

i was thinking about something like this

      
        float desiredSpeed = Input.GetAxis(someAxis) * maxSpeed; // some input * maxspeed.


        // velocity in relative space:
        var localVelocity = transform.worldToLocalMatrix.rotation * rb.velocity;

        // our current speed is down Z:
        var currentSpeed = localVelocity.z;

        // the difference between our current speed and our desired speed,
        // regardless of if we are moving or stationary...
        var error = desiredSpeed - currentSpeed;

        if(error < 0)
            error *= somevalue;// we can scale it to control braking force
        else
            error *= someOtherValue; // we can scale it to control accelleration force.

        rb.AddRelativeForce(Vector3.forward * error * someScalingValue);
#

because regarless of input, your vehicle will try to match whatever desired speed is along it's Z -Plane

#

you can then just use Drag to control friction as well probably.

viral ginkgo
#

left is my model, right is your model

#

they are the same

stuck bay
#

then what am I misunderstanding :/

viral ginkgo
#

i told you they are the same

stuck bay
#

ok

#

is there a youtube tutorial or something on this force max speed thing?

#

I figured there is some other objective I was missing. I guess not.

viral ginkgo
#

nope

stuck bay
#

@stuck bay - it's basically just relativity.

#

i need coffee and to murder my pillow. have fun.

#

of which i know nothing about

viral ginkgo
#

but if you keep friction seperate to forward force, its just easy to change how friction works
like quadratic friction for example
it would be hard to archieve with your code

stuck bay
#

2 AM here, gotta wake up at 7 AM, a bit too late for me to go to bed XD

#

i tried many different ways. i just cant wrap my head around them

#

1AM here.

viral ginkgo
#

2am here too

stuck bay
#

I am in tthe past - speaking to the future.

#

As thats mostly all i know

viral ginkgo
#

i just see multipliers to some vectors

#

i mean wouldnt mind if Top_Speed = 10 is 24.54213f units per second in unity

stuck bay
#

i see bunch of nonsense ifs and bools, thousand line code which does absolutely nothing

#

wait, so unity isnt m/s?

viral ginkgo
#

meter, kilogram, second

stuck bay
#

yeah. The tank is meant to move 10 m/s

viral ginkgo
#

1m is lenght of the default cube

stuck bay
#

yup.

#

Each prop in the video is 5x5

viral ginkgo
#

you could figure out how to make it 10m/s with that graph or OTAKU's code

stuck bay
#

from what im understanding, otakus script doesnt account for acceleration/deceleration etc

viral ginkgo
#

you just set target speed

stuck bay
#

that can be 14m/s velocity or 10 m/s velocity in either dirrection.

#

maximum speed is dynamic.

viral ginkgo
#

you can have like max forward speed, max bacward speed
desired speed

and just clamp the desired speed between the two
while giving user full control of the desired speed

stuck bay
#

but if i clamp the velocity, wont it go at 14 m/s and then suddently drop to 10m/s if the max speed changes?

#

now im decelerating it and the max speed moves somewhere from 8 m/s to 12 m/s randomly

viral ginkgo
#

@stuck bay no, you are not clamping the velocity, you are clamping the desired velocity

#

and then your forces make the velocity match the desired velocity

stuck bay
#

im about to give up on the god damn velocity thing and let the tank move as fast as long the user hold velocity...

#

cause honestly i understood nothing about the friction thing, my tank wiggles when its on low velocity and rapidly changes velocity when its at its max velocity.

stuck bay
#

ive spent weeks on it and i cant even reproduce the hull suspension

broken frost
#

I am experiencing some bizarre jittering, rotation and micro translations when moving across the ground. Anyone know what could be causing this?

slender cobalt
#

have you using a sigle object for the blue ground and the purple @broken frost ?

tiny wedge
#

@stuck bay well what i did was using normal wheels. To each wheel was connected a bone that deformed the track when moving up and down.

glossy canopy
#

Hello,

What's the best way how to cloth hair bones.

slender cobalt
#

@glossy canopy hae you looked some hair shader asets on the aset store ? Ok it can be difficult to have one for free in but try ;).

glossy canopy
#

well i have character with hair and hair bones

#

not sure if i want low poly model alias polygonal hand painted model with hair shaders 🙏🏻😁

wraith crown
#

meant to ask this in here!

#

if I'm tying to work out what the new RPM/torque of a drive shaft is, after connecting a new shaft/power source...

#

if the RPM/torque on one side is, say, 100RPM and 2 Nm, and the other is 50RPM but 5 Nm

slender cobalt
#

Idk me too and Im only using add force sorry

wraith crown
#

how do I work out what it will be