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"

Rotate Character With Mouse Movement

I'm using a simple pawn for my player character. Basically, it's a spiky wheel that runs over baddies. I am controlling the pawn's movement with the mouse as shown in the blueprint below. This works better than any of the pawn or character movement stuff I tried because they all lagged the mouse. However, I'm having no luck setting the pawn's rotation. I want the player wheel to turn in the direction the mouse is moving. Any suggestions appreciated. Bonus points if you can tell me how to lean the tire in the direction of turns!

![alt text][1] [1]: /storage/temp/89787-character_mouse_movement.png

Product Version: UE 4.11
Tags:
more ▼

asked May 07 '16 at 10:27 PM in Blueprint Scripting

avatar image

ThunderChicken
13 5 3 4

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

in that BP you're continually setting the actor rotation to 0 so it will always have that rotation on tick.... try playing with the rotation portion there, namely the yaw. I dont know the exact nodes to use off the top of my head, but you're probably gonna want to find the location of the mouse pointer (within a clamped region maybe) and then point the pawn at that rotation

more ▼

answered May 09 '16 at 08:08 PM

avatar image

thankstipscom
644 38 37 70

avatar image ThunderChicken May 09 '16 at 09:01 PM

Thanks for the answer! I have played around with various approaches to setting the rotation. This is as close as I've gotten. Doing this, If Get Move Forward is attached to X, I get an invisible line down the center of the play area and when I'm on the left of that line the player faces left, right of the line the player faces right. If I attach to Y, it changes from horizontal to vertical but does the same thing.

I tried to attach Get Move Right to the other axis, both ways, and it stops rotating again at all.

I also tried the Input Axis Move Forward Event with not luck so far.

alt text

rotation.png (555.1 kB)
avatar image thankstipscom May 09 '16 at 09:51 PM

its hard to understand what you're doing exactly without seeing it. Maybe post a quick video on what it looks like in action

avatar image ThunderChicken May 10 '16 at 10:47 AM

I don't have an easy way to take a video. My camera is fixed in the middle above the arena. When my player is on the left side of the screen he faces left, when he's on the right side of the screen he faces right. So, that is what the setup above does, but that is not what I want. Does that help?

avatar image thankstipscom May 10 '16 at 09:20 PM

Not really... like its hard to envision what the gameplay looks like. The "player" is a spikey ball? So when you move the mouse (cursor) the ball rolls toward that direction? Like no click needed, just moving the mouse. Does it just skate along right now? or does it roll?

The confusing part is the rotation aspect. Does this ball have a face ? you want the face of the ball to rotate to face where the mouse is... so it doesnt look like its rolling backwards?

like I said.. hard to envision.

avatar image ThunderChicken May 12 '16 at 01:17 PM

The spiked ball is more like a tire than a ball. It has a clear direction in which it needs to roll.

avatar image thankstipscom May 12 '16 at 04:07 PM

is it top down view? or third person?

avatar image ThunderChicken May 14 '16 at 12:30 PM

Top Down and I have fixed the camera so that it is stationary.

avatar image thankstipscom May 14 '16 at 07:38 PM

it would be good to have more visuals.... a quick vid of the behvior now.

I havent played with that template but doesnt the character face the location and move to the location the player clicks on in the top down template?

can you take that same idea but have it perform it every tick rather than when the mouse is clicked?

(comments are locked)
10|2000 characters needed characters left

check this may be this will help u Part1 https://youtu.be/I7WW7uzdeiA Part 2 https://youtu.be/JdC7T6I7WG0

more ▼

answered Dec 10 '16 at 05:25 PM

avatar image

sagar Chauhan
0 2 3

(comments are locked)
10|2000 characters needed characters left
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