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"

Fixed top down camera, and character rotation.

Hi the hub.

Probably a simple problem, yet i can't get a solution.

Imagine a tennis game, fixed top-down camera. My input are always relative to world space, so my character goes up / down and left / right on the court (relative to the camera), but it always face the right side of the court (east). I want it to face the direction it is moving to.

I used the "get last movement input vector", it successfully make him face the direction of its movements BUT as soon as there is no more input, as soon it stop, it just faces again the right side of the court. (east)

How can I get it to keep his last rotation ? Maybe few tweak would do or maybe i should change the whole.


alt text

Product Version: UE 4.14
screenshot_1.png (139.3 kB)
more ▼

asked Nov 25 '16 at 10:00 AM in Blueprint Scripting

avatar image

108 8 12 14

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

1 answer: sort voted first

Store a local vector and keep updating it as your inputs fire. Then use that direction to set the orientation. That way it wont reset.


more ▼

answered Nov 25 '16 at 10:10 AM

avatar image

2.7k 107 35 180

avatar image Theblacktiger Nov 25 '16 at 10:26 AM

Ho, I understand why this should work. The local vector should not be updating as no input are fired. So I tried, but it doesn't work and the vector get reset anyway. Maybe my flow is bad.

alt text

screenshot_2.png (156.9 kB)
avatar image Theblacktiger Nov 25 '16 at 01:20 PM

Okay, might I found a way, it does keep the orientation vector, But because of the way i test "is different =!= 0.0,0.0" it doesn't allow to remember any of the four corners direction to be set in the variable. Getting close tho.alt text


Better way to test if the orientation is different than 0,0 Works. alt text

screenshot_3.png (236.4 kB)
screenshot_4.png (184.3 kB)
screenshot_4.png (184.3 kB)
avatar image NoobsDeSroobs Nov 25 '16 at 06:36 PM

To be honest I dont understand what you try to achieve with the first part of the sequence. You dont need that at all I think. That is where the problem is and that is why I said you should just update it without doing the check there.

(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