Move character with animation using CharacterMoment component
Hello everyone. I'm trying to make a turn based game on a 3D hexagonal tile based environment. The level data (2D array) will be received from server and then the tiles are spawned using spawn actor function. (server yet to be implemented). I'm using "Maximo Animation Pack" and spawned one character using BlueprintImplementableEvent and enabled simulate physics on capsule collider component.
and using this function to spawn the character as APawn* and enabling the capsule collider's simulate physics.
I googled alot on how to move character and there are many solutions and I tried everything. Character moves but its not doing walk animating. It is behaving like a static mesh just sliding like its position being updated in Tick.
Here are list of things i tried:
Implemented AddActorLocalOffset function in blueprint as BlueprintImplementableEvent and called it inside Tick().
Blueprint implementation of this function:
When I run this, character just slide for sometime and falls down. Worst part is character keeps sliding but when he is about to fall he does walk animation. He does animation only when he is falling. I uploaded the video please look at the video.
Everything is same as method 1 expect that this time I used AddMomentInput in MoveCharacter function in blueprint.
I read that for AddMomentInput to work the character needs to be possessed by a controller. So I did this after spawning the character.
But this time, character is not moving at all.
I thought of using the AI navigation system. So I created a NavMeshBoundsVolume and made it very large so that is encompass all the level. In character blueprint I made the AI Controller Class as "AIController". I tried moving character using C++ and also blueprints both are not working. In C++, I creates a function called SimpleMoveToLocation in NavigationSystem.
In OutputLog this is what that came.
Even in this method, character is not moving at all. Of course with so many values as null its expected that character wont be moving.
These are the three methods I tired. I'm very new to unreal engine and i'm trying to learn the engine. I hope i explained my problem and everything I tried clearly so that you have all info before replying me. Please direct me in direction.
Thanks in advance.
bump T_T i'm still looking for answer :(
answered Jun 24 '16 at 04:03 PM
I'm not sure of a way to get a transform operation to generate velocity. I feel I've done this before but I could not quickly replicate it.
One work around is to figure your own velocity. I've done this in an animBP by just recording what the previous location was and using that to figure my current velocity.
Also, I just wanted to throw out there the idea of using a VInterp to interpolate between your tile spaces. I like this because it is guaranteed to go from start to finish location without any fuss or clamping. There are many ways to do it but i found this quite simple if simple is what you need. Here it is on Tick but could be a timeline or timer.
answered May 15 '16 at 04:07 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here