I followed everything you told me, hoping I followed it right, however, something went wrong, a new bug showed up: when I press crouch input, the character no longer comes back up, but remains permanently crouched.
Hi there,
Don’t worry about it. You did a great job.
Now that you have all done, it’s easier to do the debugging. For instance, have you set the initial value of “can uncrouch?” to true on begin play? Also, there are booleans disconnected from branch nodes. Did you missed simething or maybe you don’t need them anymore? Such as “already crouching” and “can sprint”? Do you really need those booleans?
Try to review your code reading through every step and ask yourself what do you expect to happen in every block of code.
For instance, input action crouch “released” you’re calling event uncrouch twice. You can remove the second call in the end.
You just need to fix the branches in both input action events. The rest of your code is OK.
oops, I totally forgot to set the Can Uncrouch? value to true and fixed it right away!
I removed the two variables Already Crouching and Can Sprint? and the character sprinted again!
I removed the second uncrouch call in the crouch input, I hadn’t noticed it at all…
The only thing is that the character remains crouching even when the crouch input is not pressed I am not understanding what conflicts with it
Thanks. I am guessing you uncrouch is bugged because your capsule trace is hitting your own charater and is registering a false structure above. It shouldn’t be the case, because “ignore self” is set to true.
To debug, on capsule trace, change “draw debug type” to every frame or persistent and see the color code in playtest. Green is the default color for hits. So, you want to see trace hits only if crouching underneath a structrure.
I activated Draw Debug Type and it seems that most of the color is red (Corresponding to Trace Color) although green color is present (In small part [Trace Hit Color])
I’ll show you:
I figured, your final assignment is to find the correct settings. A quick one is to replace “capsule trace by channel” by “capsule trace per objects” and use “World Static” as the only option (dark green array icon, select and right click and find “make array”, a list of options will appear). Everything else is the same.
I’ve noticed that too, I haven’t gotten to the point of modifying objects or structures yet, just the player’s movement, the only thing that cube has is to have physics, which is the basic physics of the first person template, also I’ve fixed what you told me, I’ll attach the screen:
I also tried deleting the cube, but nothing changed,
I also found out this strange “Dinosaur” (?) But it was automatically generated in the template, so I don’t know but it was in the position where the green lines started…
Can you please show how your character is setup? Can you record a video showing the components mesh capsule camera etc.
Also, can you select your capsule and go in the details panel, and set hidden in game to false? It seems your capsule is stucked at origin while you move your camera around.
I may have found the problem: after the Capsule Trace For Object, I inserted a Break Hit result, and connected the blue branch (On Hit) to it and connected Initial Overlap as a condition to the branch, I don’t know if I was clear, but in case I attach a screen.
Now the character if he is not under a structure, he will crouch correctly, but when he is under a structure and releases the crouch input, upon exiting the structure he will stay down until the next crocuh input