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"

how to smoothly rotate a character to target, without moving.

i have two different characters id like to make rotate in a particular way.

one character needs to rotate and face its target before moving out towards it.

another character i need to approach the player and once in range continues to face the player but can only rotate so fast as to allow the player to get behind it for flanking damage.

i understand that disabling "Use Controller Rotation Yaw" in pawn and then changing the "Rotation Rate">Yaw to some number helps with making smooth rotations, but that only helps if the characters are moving.

how to i get them to slowly and smoothly rotate to face an actor target with out doing a movement command??

Product Version: Not Selected
Tags:
more ▼

asked Aug 12 '14 at 07:09 AM in Blueprint Scripting

avatar image

ClaverFlav
357 29 148 200

avatar image Alan Webster Aug 12 '14 at 08:24 AM

Have you tried the RINTERP node?

avatar image Adam Davis STAFF Aug 12 '14 at 07:11 PM

Use a Find look at rotation which you can plug into the RInterp node Alan mentions. You will want to set the Find Look at Rotation to the player location/rotation

avatar image ClaverFlav Aug 13 '14 at 04:37 AM

thanks guys, totally works.

cheers!

avatar image ClaverFlav Aug 13 '14 at 12:28 PM

crap, k new question thats totally relevant. i need to know when the character is looking directly at the player/target. so i did a if RinterpTo resulting rotator is equal to the input target variable (made from the FindLookAtRotation) then print "done" didnt work.

so i figured maybe theres some pitch or roll going on so i break both rotators and check if the yaw is equal between the two, still doesnt print "done"

is there a better way to compare rotators?

avatar image Adam Davis STAFF Aug 15 '14 at 07:10 PM

Hi ClaverFlav,

Can you show me what you have so far? I might be able to see what is going on and come up with a viable solution.

avatar image Adam Davis STAFF Aug 25 '14 at 06:29 PM

Hi ClaverFlav,

Rotators work off of degrees. However, if you are using a relative rotation, it may be offsetting everything each time it is used.

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

1 answer: sort voted first

Got it to work using both rotators yaws in a float Nearly Equal node with error tolerance of 2. anything lower didnt work.

now i need to find what way it is turning to determine what animation to play, turn left or turn right.

if i compare if the yaw of one is greater than the other ones yaw i assumed it was turning right which worked only on the first time it does it, after that it just starts playing the wrong anim for the rotation.

what the hell are rotators? degrees or radians or new values everytime??

more ▼

answered Aug 23 '14 at 07:18 PM

avatar image

ClaverFlav
357 29 148 200

avatar image adamoverton May 05 '16 at 10:47 PM

Rotators are a combination of yaw, pitch, and roll rotations. Right click one in a blueprint and split it up to see!

avatar image rickdlol May 16 '16 at 07:43 PM

I would like to know the solution to this as well!

avatar image ClaverFlav May 19 '16 at 04:00 PM

So rickdlol I actually ended up using vectors instead for determining whether it was gonna turn left or right. So I would grab the characters forward vector, then the direction vector to the target, I had to flatten both by setting their a to 0, then normalized them and then I calculated the angle between the two vectors which I THINK is the cosine of the dot product of the two vectors. Then the result goes somewhere between 180 to -180 and I think negative was left.

Hope this helps.

(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