x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Sync animation frames to mouse movement

Looking for a little guidance if possible. My game is completely centered around a rigged character that will utilize many different "swinging" animations (think Golf) based on distance to a target. However, I have zero need for traditional movement controls as the character will always be aligned to the ball. What I'm trying to setup via blueprint is a control system that simply allows the player to control the swing animation by moving their mouse back and forth along the X or Y axis.

EX: Player clicks on character to initialize start of swing, then as the mouse is pulled back the back swing animation plays frame by frame in sync at the rate the mouse is moved. Then the player pushes the mouse forward in opposite direction for the down swing motion and animation.

About a year ago I was able to mock together this control system for Unity via C# in just a few days using OnMouseDown for swing start and Vector3 mouseDelta to set the input position. I then compared the last mouse coordinate to the mouseDelta.x position to determine direction of mouse movement & animation to play (down or back swing). An animation.Crossfade was used to blend the transition between back and down swings. Lastly, I normalized the animation time so that it synced to the current mouse position based on screen width. animation ["Backswing"].normalizedTime = 3.0f * Input.mousePosition.x / Screen.width - 1;

In my case, since the main character is stationary at all times other than aim by camera rotation, would I be better off using a Pawn rather than Character? Also, would this be easier to achieve via AnimMontage?? I would like to use the UE4 anim blending for back to down swing transition but again it seems to be targeted at more traditional character control (walk -> jog -> run).

Being quite new to UE4 I hoping for some direction at tackling this in a blueprint because to be honest I'm a bit lost. I've scoured answerhub and other forums for a similar topic but seemingly every animation & control posting is related to more traditional character control schemes.

Thanks in advance,

Uvhausen

Product Version: UE 4.7
Tags:
more ▼

asked May 22 '15 at 06:11 PM in Blueprint Scripting

avatar image

Uvhausen
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Could someone be kind enough of to point me in the right direction or at least a good starting point?

Thank you,

Uvhausen

more ▼

answered Oct 20 '15 at 02:23 PM

avatar image

Uvhausen
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question