Skip to main content
16 events
when toggle format what by license comment
Nov 24, 2020 at 20:33 comment added Kevin @ThanosLoupas Great, glad to help.
Nov 21, 2020 at 2:42 vote accept Thanos Loupas
Nov 21, 2020 at 2:42 comment added Thanos Loupas I found it. I modified jump with velocity.y*= -1; when on down side. That's all ! We did it. Thank you so much for your time!!
Nov 21, 2020 at 2:23 comment added Thanos Loupas You are right !!! It solved the weird bouncing effect. The only problem now is that I cannot perform jump when the player is on the down side.
Nov 21, 2020 at 2:00 comment added Kevin @ThanosLoupas Thanks. At the bottom of your script you change some bools in the Animator. I'd guess that one of these animations is moving the object downward when it becomes grounded.
Nov 21, 2020 at 0:36 comment added Thanos Loupas I updated , with the collision code and the update function
Nov 21, 2020 at 0:29 comment added Kevin @ThanosLoupas Please edit your question and show all of your code, instead of mentioning missing code in the comments.
Nov 21, 2020 at 0:14 comment added Kevin @ThanosLoupas I don't see any reason for this to happen in your code. My best guess at this point is you have some other code that you haven't shared that is changing the object's position, perhaps when it collides with something or becomes grounded.
Nov 21, 2020 at 0:08 comment added Thanos Loupas _isGrounded = Physics.CheckSphere(groundCheck.position, 0.4f, whatIsGround); This works propely.
Nov 21, 2020 at 0:07 comment added Kevin @ThanosLoupas Please add the code that sets _isGrounded to your question.
Nov 20, 2020 at 23:55 comment added Thanos Loupas I did and this is the result : drive.google.com/file/d/1PVIiBqLCgmqM9rAPt2QlX7DvkHE-hPSg/… Note that I am not pressing jump , it just happens. This is the bouncing effect I stated at first.
Nov 20, 2020 at 23:30 comment added Kevin @ThanosLoupas You're right, I had a couple of mistakes. Try it now.
Nov 20, 2020 at 23:30 history edited Kevin CC BY-SA 4.0
more fixes
Nov 20, 2020 at 23:15 comment added Thanos Loupas Have a look to the inspector in the velocity values , when above and when bellow. drive.google.com/file/d/1m9P50ONdOp5fepuQitC7V4Ym2zE_6yPS/…
Nov 20, 2020 at 23:08 comment added Thanos Loupas Yes this is exactly how gravityScale works. The velocity setting (-2 or 0) doesnt really matter. I followed Brackeys tutorial and he set it to -2 which works and doesnt really affect. This condition resets the Velocity and stays stable. I tried your code and it doesnt work. Also it doesnt make sense , since the object cant be _isGrounded and isFalling at the same time. I agree that the velocity.y += gravityScale * globalGravity * Time.deltaTime; is the line making the increment , but this is why we use the if to keep the velocity stable when the player isnt jumping or falling.
Nov 20, 2020 at 22:48 history answered Kevin CC BY-SA 4.0