Forum rules - please read before posting.

When speedScale is high, Rigidbody flies when colliding with square collision.

Maybe this is not an AC question, though, maybe not a bad idea to include a sort of collision in an upcomming update where AC is able to avoid this problem with the collision. I will explain in more detail: when my runSpeed is set to let's say 1 or 2, the Rigidbody can collide without problems into the collision cubes (one is vertical and the other one is horizontal, they cross eachother so they make a square, just like the collision of the 3D demo of AC). However, when the speed of the character (Runspeed) is set to 4 or 6 for example, the character tries to lift the Rigidbody upwards, which is kind of annoying because I dont want a flying character in my game (its just bad collision). What I can do to prevent this is to make a trigger and freeze the Y axis of my character, but I think this is a silly work around for such problem..

Comments

  • edited May 2015
    This demonstrates the problem:

    image
  • I suspect this is down to your various settings on both the Rigidbody component itself, and your Physics Inspector (in Edit -> Project settings).  AC doesn't have any physics system of it's own, so character movement is still guided by Unity's.
  • Hi Chris, that unfortunately doesnt solve it. My character has a normal capsule collider and just doesnt seem to be able to distinquise the gravity correctly when in a squared collision, nothing wrong in my settings. So I use onCollisionEnter and I need to use the Rigidbody constraints. Unfortunately I cant seem to find how to enable or disable Rigidbody constraints from AC, I tried AC.Kickstarter.player. .... and then what? Because my own code seems to get overriden by AC, that means that I am not able to influence the Y axis of the Rigidbody which I drastically need to acces as you can see above. 

    void OnCollisionEnter(Collision col){
    if(col.gameObject.layer == 2){


    frb.constraints = RigidbodyConstraints.FreezePositionY;
    //AC.KickStarter.player.direction

    }
    else{

    frb.constraints = originalConstraints;

    }






    }
  • (Oh, and I cant turn AC off, that is really no option since this is in gameplay)
  • (Btw: I said flying in the air, but that is not correct, my character is walking and then slowly lifts up when holding the forward key)
  • You can disable AC's Rigidbody overriding by commenting out lines 616-626 in Char.cs.  But my point about the Physics settings wasn't so much about fixing anything as it was about tweaking them to get better results.
  • Yes, I tried but nothing seems to work: I tried to change the rigidbody settings and all physics settings, my character still is walking on the collider when the speed is greater than 3, and I dont have any custom scripts for this so....I dont know what else I can do there. But thanks again for your help, I will see.. I think there are no other options (or at least not that I know) then removing the lines from Char.cs and control the Rigidbody through code from myself.
  • Are you working with Point And Click movement or Direct control?  If you're using Mecanim's root motion with Direct, you have an option to slow movement as you near wall colliders.
  • That sounds good, but I cant find that setting. I looked in the player script and in settings, but its not there as far as I can see. (I am using Direct indeed with Mecanim)
  • It was a fairly recent addition - you're using the latest version of AC?  It should be in the Player's Inspector, under "Mecanim settings".
  • edited May 2015
    Sorry, I still use 1.43 because of another reason that asks for a new thread.. I will post it tomorrow. But thats good news!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.