#Alright, sorry. My problem is that when
1 messages · Page 1 of 1 (latest)
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
https://paste.ofcode.org/dCG4pU92xQDChTJR7DeniV this is the code properly shared using a paste site
// Apply movement to the character
MoveCharacter(moveDirection);
// Rotate the character to face the movement direction without tilting
RotateCharacter(moveDirection);
moveDirection = Vector3.ProjectOnPlane(moveDirection, Vector3.up).normalized;```
As I mentioned before, you need to do the ProjectOnPlane _before_ calling those functions otherwise it's pointless
Go back and read all the stuff I said here: #💻┃code-beginner message
This too: #💻┃code-beginner message
https://paste.ofcode.org/uvnmFfUmM7EDePbPqxzVhw I put the ProjectOnPlane like in your example in this message, but it still doesnt seem to be working
@shy wind is there a way to lock the x axis rotation of the transform?
you're still not following directions
you have to do it BEFORE the calls to MoveCharacter/RotateCharacter
once you follow directions, it will work
https://paste.ofcode.org/nKHAjQmmVk4yGbfUbHgNLC
@shy wind I put it before it calls both functions, this is how I have to put it right? because it still is not working
If I put it before, I cant because the movedirection variable doesn't exist yet
yes just like this
So now the code is good
the last thing that remains is as we called out much earlier - your 3D model is not imported to Unity correctly
I also tried fixing that. I made it in blender, really simple model. But it isn't rotated properly, but when I rotate it in blender, It imports the same way, do you know how to fix that?