So as part of a project, I’m trying to get my character to interact with the door using animation as part of the story because the door breaks and the character has to pry it open by hand. So I made both the animations for the character and the door in Maya the character is mostly just blocked poses and I was using someone else’s project to reverse engineer it for the code of interacting with the door. However It doesn’t work the way it should if you go to the link down below there is both a video of how I want the character to interact in Maya and what actually happens UE4, also the working files for UE4 so you can see what I’m doing wrong. I also need some assistance on making the blueprint actor have collision because the skeletal mesh has custom collision however it doesn’t exist within the blueprint.
Gotta say, this is a pretty open ended question. Basically, what you have to do is make the character perform the same sequence of animations and time it with code which moves the doors in the same way.
Apart from that, I can see you’ve got collision problems. By default the player should not be able to get so close to the door. Have you messed with the capsule on the player? Or does that door asset have no collision?
The door is a skeletal mesh with its own custom collision capsules, it’s just the blueprint actor version of the mesh refuses to inherit it’s physics assets and no I haven’t touched the characters capsule. So the player is meant to teleport to the correct position after overlapping with the trigger attached with the door, then play the animation. So far the door animation, plays but the montage that is meant to play the characters doesn’t happen. I’ll attach the code just so you can have a look at what I’m doing wrong.
Don’t worry about the collision part the collision of the skeletal mesh in the blueprint was set to no collision so I set it to custom physics
Ok, lots of strange stuff going on with the right of the timeline.
So, some things in no particular order:
-
You’re setting the open variable every frame
-
I thought the playanimation node does it’s own thing, can’t you just call it once?
-
Why are you using lerps AND play animation?
-
If you are going to use lerps with a timeline BOTH ends of the lerp have to be fixed. One is, but the other isn’t ( world location and rotation sampler )
Must confess, I don’t use skel meshes, just do it all in BP, so my knowledge of skel anim may be sketchy…
PS - not being critical, just trying to make it compact… I can’t see what the lerps are going into, but I think your main problem is that you’re thinking you’re calling everything once on the right, but it’s all getting called every frame
Firstly the timeline that drives the door open or closed should be handled by the door blueprint not the player. Then with the player animation find the point in its animation cycle where your hand would touch the door (you might need to create a montage) and set notify begin at that point. Then from the play montage node in Blueprints drag out from notify begin and call your custom event that opens the door.
from what I have understood when replicating this guys code it seems that the lerps control the position of the character, teleporting him to the front of the door, where he will need to be for the animation. Then it calls the animation. I kinda don’t get what you mean with 2. I’m not too sure however I’m assuming the timeline is controlling the lerps teleportation in some way that I don’t quite understand. Also if it was calling it every frame wouldn’t the door animation also not play.
Just so you have a reference on the UE4 project that I’m working off, you can install his file if you want and see what he does in it.
Yeah I got having everything in the character blueprint because of the code I was following if you want to check out the file attached to the video. It allows the player to interact with a door that can go both ways I deleted the reverse able part because I just want the player to open it and that’s it. However he does what I’m doing and it comes out pretty nicely.
I’m just not sure how to make this it seemed useful
I’m just saying, if you take everything after the lerps ( and the node they’re with ) and put them on the left before the ‘play from start’ it will work much better
Hey, i have used the same function and it works but my character is after the anim is played again at the start Point of the animation and stands in front of the door cause the capsule wont follow the Animation. What did i wrong?
I’d have to see you BP…