Home Unreal Engine

UE4 - How to move a bone when button is pressed?

Funnynel42
polycounter lvl 3
Offline / Send Message
Funnynel42 polycounter lvl 3
Hi

I have run into a problem that is taking me a while to figure out. I have created a complex vehicle, and need to rotate some bones on the model when I press a input button. I haven't made any animations, and I just use the mesh as a skeletal rig when I import it.

I have attached a test image of what I'm trying to do. I want to rotate the boom between point A to point B when I press a button. It needs to rotate over time, and if I release the button, it needs to stop where it is.

How should I go about creating it in blueprints? Will I need to create the animation for it and play it to achieve my goal, or can I just do it inside of UE4?

Thanks.

29988-questionboom.jpg

Replies

  • Vailias
  • Funnynel42
    Options
    Offline / Send Message
    Funnynel42 polycounter lvl 3
    I figured it out.
    That SkeletonControls page only helped a little as it didn't have the info on it that I was looking for. I knew about the transform bone tool, but I needed a way to animate it in game with custom values I give it.

    The solution I used is this:
    I have my input buttons which I use to play and reverse a custom Timeline animation that controls the alpha values between the Lerp functions in my class blueprint. Then I set those values into variables that are open.
    30205-comp01.jpg

    Then in Event Graph in the animation blueprint I get those values from the class blueprint and assign them to new variable to use in the animation blueprint.
    30207-comp02.jpg

    Then I just plug those values into to Transform bone modifier and it works just as I want it to.
    30208-comp03.jpg
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Glad you solved it. :)
  • Khaja
    Options
    Offline / Send Message
    Gool to see this fixed. As a note you could have just added the bucket part as a static mesh component with the origin in the right place and rotated it through the same timeline method. no need for skinning then. But you're probably doing more complex stuff so it's cool to see.
  • Funnynel42
    Options
    Offline / Send Message
    Funnynel42 polycounter lvl 3
    This was one problem that I struggled with for over two weeks. Then I found out how to communicate between blueprints and things went smoothly again.

    The model I'm using is already built the way it is easily usable by myself and others at the office. We are testing a few things out with the engine to see if we can use it properly in the company.

    We already have a collection of models that are built in the correct size and every part is movable through the hierarchy.It is important to keep most meshes as complete as possible without separating any meshes. This project is very similar to training simulators, and that is as much information as I can give at the moment.

    This way, we also get a skeletal mesh that fits the machine so it is easier to reuse it with other models too.

    On a side note, I am busy working on a tutorial on how to create a buggy similar to the advanced vehicle project example that actually explains what is going on and how things works without the rigging it with bones beforehand.
  • newdude420
    Options
    Offline / Send Message
    Where might I find this tutorial ?
Sign In or Register to comment.