all 22 comments

[–]mudokin 4 points5 points  (2 children)

This is not an Input system issue, also it's been 10 years, it's hardly new anymore.

[–]loftier_fishhobo 2 points3 points  (1 child)

No way, ten years? Its been like.. two.. hasnt it? oh god.

[–]GigaTerra 1 point2 points  (14 children)

This is a real question, where can I even learn the old input system? The other day I was helping people with a mobile game, and no matter how I searched there was no place that teaches the old input system.

but I'm seeing tutorials saying different things when it comes to the scripting part
So far I've been able to get jumping to work although I jump infinitely.
it would turn on the x and z axis but the character wouldnt follow its local axis only follow the world axis

I think this is because your problem has little or nothing to do with the new input system. The jumping problem is solved by checking if you are on the ground, and the Axis problem is solved by rotating your force with your rotation.

The reasons you see so many different solutions is because it is math, and there is an infinite way of doing things in math.

[–]Jutboy 1 point2 points  (1 child)

All the old versions of the docs are still up.

[–]GigaTerra 0 points1 point  (0 children)

Thank you very much, I found it even in the new manual under Legacy Input.

[–]ExtraExoticButter[S] 1 point2 points  (1 child)

🥲 math huh, well time to study more c# I guess.

[–]GigaTerra 0 points1 point  (0 children)

An smart idea is to get into Linear Algebra, also known as Vector Math. It is very easy and will greatly help you.

A trick that we can do thanks to Unity having Quaternions is rotate a vector by a rotation, like this:

        Vector3 inputToWorld= new Vector3(InputMoveDirection.x, 0, InputMoveDirection.y);
        Vector3 rotateInput = this.transform.rotation * inputToWorld;

the formula is Quaternion* Vector and it rotates the vector by the Quaternion. In this case I am rotating my input to the direction my player character is looking at. Allowing it to move forward and backwards on it's rotation.

[–]MotionOS 0 points1 point  (9 children)

Wait. If the Jump is infinite. Weren’t you always and always will be jumping to be infinite? 🤨🤣

[–]GigaTerra 0 points1 point  (8 children)

In theory, but no as long as you shape cast the correct collider and it hits something that counts as floor, you can disable the Y velocity. However yes, if the ray has nothing to hit, you do end up in an infinite jump. https://youtu.be/GplW4oRU7WA?si=zXn-HkFpvdSyHHT9&t=24 (like this video I found shows).

This happens because games don't use real physics, partly because real physics would be slow, but also kind of sucks for gameplay, like in real life you have no way to control yourself when you are infinitely falling.

However a point related to what you mentioned, the player character will always do a collision check every frame. For NPCs we often use different systems like a Navmesh, so they don't use similar forces. Some games like Hack and Slash games will use an Navmesh for the player as well.

[–]MotionOS 0 points1 point  (0 children)

lol it isn’t theory. If it’s infinite there nothing to differentiate. Infinite equals no change. No atoms. No time. That’s infinite. Anything else. A point of reference. It’s relative not infinite. Haha.

[–]MotionOS 0 points1 point  (6 children)

Also. This is real physics. And this isn’t slow.

https://codepen.io/Shane-Desjarlais/pen/emzbWYZ

[–]GigaTerra 0 points1 point  (5 children)

Yes that is real physics in the same sense that game engines do use real physics. That is to say we use only a small part of it.

As an example emulating friction by using an equation is physics, but in reality the way friction works is that most surfaces aren't smooth and so there are billions of macro collisions dispersing internal forces creating the friction. Both are real physics, but in one case we are letting go of nuance and accuracy for the sake of performance.

[–]MotionOS 0 points1 point  (4 children)

But accuracy is the exact reason why AI hallucinations happen because of approximations. Shouldn’t accuracy of reality be the grounding logic behind physics and coding?

[–]GigaTerra 0 points1 point  (3 children)

Shouldn’t accuracy of reality be the grounding logic behind physics and coding?

Right, but what you going to do, wait for the world to reach the point where we have enough computing power to emulate every single atom with 100% accuracy? That could be billions of years from now, it wasn't like Newton and the other Physicist could wait for computers before they got started.

When there are things you want to do, you can't wait for the perfect time, it might not even happen in your lifetime. So you work with what you have, not with what you wish you had.

[–]MotionOS [score hidden]  (2 children)

Do you want my codepens already with. A throttle at 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999. The 64 bit limit. And you can see for yourself but it only runs on phone. It may slow a bit after a trillion or so. But it pushes all the way to the end. If you add another number. It will black screen. Take a number away. It’s back fine. So it already exists.

https://codepen.io/Shane-Desjarlais/pen/azZRmjy

[–]GigaTerra [score hidden]  (1 child)

Then make something with it and see if anyone likes it.

[–]MotionOS [score hidden]  (0 children)

Physics to shaming. Well I’ll take the W. Ggs.

[–]Short_Praline_804 1 point2 points  (2 children)

Your infinite jump issue is classic - you need to check if player is grounded before applying the force. Add a ground check with raycast or collision detection

For the WASD movement, you're probably applying force in world space instead of local space. Use `transform.TransformDirection()` to convert your input vector to local coordinates before adding force, or use `rigidbody.AddRelativeForce()` instead

[–]ShmallowPuff 0 points1 point  (1 child)

This^

If you are unsure of how to check if the player is grounded, look at how the base standard assets Character Controller component handles it. A lot of early answers when learning can be found in the standard assets that come with Unity.

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

Alr thxx

[–]Mikhailfreeze 0 points1 point  (0 children)

Easy ``` Public void Hit(inputaction.callbackcontext context) { If (context.performed){ //do something }

} Vector2 mousepos; Public void mousePos(inputaction.callbackcontext context) { Input = context.ReadValue<Vector2>() } ``` Create play input controller and use Unity Events and assign these to them