Closed warrenchopin closed 2 months ago
@warrenchopin try setting _freeFall to true instead of false. Let me know if that works
The above error was raised when _inFreeFall= true. I edited the posting correctly.
I tested both _inFreeFall= true and false cases again for sure. The error was raised only when _inFreeFall= true
I thought about three scenarioes to solve this problem.
The best solution for me is 3. moveDiff(). It is a general function that can be used in many different situations. The problem happened after I overwrote avatar.mesh.position at collision. Overwriting position is pretty aggressive way possibly disrupting CharacterController. moveDiff() will give a way to avoid overwriting mesh.position. Is there a similar function available now?
Thanks again.
You are right in that we do need a function for fall. Just like we can do jump programmatically , we should be able to do fall too. This will be usefull for use cases like yours, moving platforms etc. Let me work on this.
In the meantime try setting CharacterController._grounded to false after collision and let me know if that works.
It worked when I set the two variables together.
cc._inFreeFall= true
cc._grounded= false
The collided avatar free falls naturally now: The problem solved. Thanks you so much for your help.
Nice. I just published a new version (0.4.4) with a cc.fall() function to force a fall. This should also play a fall animation while falling.
@ssatguru: The error was raised later again. I set only cc._grounded=false at this time, and the error disappeared again:
cc._grounded= false
I am not sure whether CharacterController is unstable, or my program is unstable in this case. I will report here if something is wrong again.
Thanks again.
Hi again,
I am implementing collisions of multiple avatars individually controlled by CharacterController and a collided avatar bounces into the mid air above the ground sometimes. The avatar in the mid air stops in the mid air until new user input . I want to make the avatar freely fall to the ground right after collision in this case.
I tried to set CharacterController._inFreeFall= true right after collision, but am error was raised as following:
How cam I programmatically force an avatar to fallFall?
I really appreciate your help.