so i am making a lean script for my game…simple right? it seems to work, lets see, ou hit q or e, the camera tilts left or right. oh ok. i see.
but wait… THE CHARACTER ZOOMS ACROSS THE MAP IN THE DIRECTION OPPOSITE THE LEAN!
I mean if i was going to have a fiddler crab as my player character this would be great. but i would like a human as the player… that being said… any ideas???
Nothing here should explicitly move your transform. Start looking at the other scripts attached to the same GameObject. There may be some weird interaction going on.
For example you are tilting a character controller that is using transform.up for gravity, and by rotating it you start falling sideways.
Try commenting this out. It seems your speed is directly affected by your rotation. Commenting it out will cause other issues, but if it stops crab movement, then you know where your issue is.
i was going for that, but what other object is there? i want to eventually have it all animated and rigged so in multiplayer, you can see the character lean and have hitboxes, etc
ive refined it and ive got it working perfectly! i disabled the mouse movement while leaning because it causes issues, and i still need to figure out crouching. im using charHeight for it, but it dosent crouch now. any ideas?