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"

Player facing wrong direction when using Add Movement Input

Hi,

I've been playing around with movement for a top-down space shooter type of game where the ship rotates to face the location of the mouse cursor and will move forward towards that point when W is pressed.

Every tick I update the rotation, like so:

alt text

And here's the MoveForward event:

alt text

When I test this the player rotates correctly when moving the mouse, however, when I try to move forwards the ship goes crazy and moves back and forth. When I'm trying to move forward the ship is trying to face the opposite direction, but the rotation stuff is kicking in and trying to get it to face the correct way and they fight it out.

alt text

I can't figure out why it's doing this. I've tried checking out the rotation settings on the character movement component which doesn't seem to change anything whether they are on or not makes no difference. The character is definitely facing the right way in my blueprint, following the arrow so it doesn't appear to be anything obvious like that. I must be missing something somewhere, or I haven't set up the movement correctly but I haven't been able to figure it out.

Product Version: Not Selected
Tags:
update_rotation.png (169.6 kB)
moveforward.png (71.2 kB)
example.png (219.9 kB)
more ▼

asked Mar 06 '15 at 10:05 AM in Blueprint Scripting

avatar image

aliiries
13 4 5 7

avatar image Erasio Mar 06 '15 at 10:45 AM

Could you try using "Get Hit Result under Cursor" instead of "Convert Mouse Location to World Space"?

I seem to remember something like that happening to me as well and the issue was that it didn't convert the location to the ground but like slightly in front of the camera or something like that. "Get Hit Result under Cursor" fixed it for me.

avatar image aliiries Mar 06 '15 at 01:43 PM

Yeah that seems to have fixed the problem, rotation is fine now. :) Thanks.

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

0 answers: sort voted first
Be the first one to answer this question
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