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"

Rotation value 180 always resets to 0?

I have a blueprint actor in my scene. In the level blueprint I have tied 3 inputs to it which change it's rotation. For example, lets say the X, Y and Z keys each add positive 90 degrees to it's local rotation in the X, Y and Z axis respectively.

Here's the rub: Rotating about the X and Z axis works flawlessly, but the Y rotation doesn't. I would expect 4 presses of the same key to rotate a full 360 degrees and return it to it's starting rotation, however the Y axis does not.The blueprint is set up in an identical fashion as the other axis, but after the second execution it resets Y Rotation to 0.

Example

[Press Y] Actor rotates from Y Rotation 0 to 90

[Press Y] Actor rotates from Y Rotation 90 to 180

[Press Y] Actor rotates from Y Rotation 0 to 90

Forgive me if this is hard to explain, I am just at a loss as to why 1 axis is behaving differently from the other two. Any help would be appreciated.

Product Version: UE 4.13
Tags:
more ▼

asked Oct 04 '16 at 08:16 AM in Blueprint Scripting

avatar image

hypersapien
194 34 30 42

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

1 answer: sort voted first

So I solved the problem. I apologize if this sounds abstract without screenshots, but here was the issue:

My blueprint network looked a little like this.

[Press Y Key] --> [Get Y Rotation of Actor] --> [Set variable "y_rot"] --> [(Some timeline lerp nodes to control the rotation animation, referencing "y_rot")] --> [Set actor Y rotation to 'y_rot'] --> [Set 'y_rot' variable to new y rotation of actor]

I did some debugging by adding two [Print String] instructions to two different inputs. One of them printed the rotation value of my actor, and the other input printed the float value in my "y_rot" variable. In theory, they should always be the same. I then changed the increment of my rotation command to 20 degrees (down from 90). So each execution would increase the rotation on the Y axis from 0 to 20, 20 to 40, etc.

I found that once this value exceeded 90 it would "invert" the value (for lack of the proper math term). So I would press the Y key to advance the rotation from 80 to 100, and after that my two [Print Strings] would disagree: one saying 100, the other saying 80. Further presses of Y repeated the same rotation from 80 degrees to 100, over and over.

I removed the first [Set variable "y_rot"] node from my network and it solved the problem.

more ▼

answered Oct 05 '16 at 01:43 AM

avatar image

hypersapien
194 34 30 42

(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