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 can I rotate an object over time when pressing a key?

Hey!

I want to rotate an object over time when a player presses a key.

I attached the blueprint i have at this moment and think i'm almost there, i only need some help on the "RInterp To" i think. Thanks for your answers!

alt text

Product Version: Not Selected
Tags:
more ▼

asked Apr 26 '14 at 03:33 PM in Blueprint Scripting

avatar image

TheBat
51 3 6 76

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

3 answers: sort voted first

Thanks for your suggestion Shadowriver

Although your suggestion was a bit cryptic i managed to find out a way to get it working! For everyone else i added my working solution, and maybe can help other people out looking for a similar solution.

alt text

more ▼

answered Apr 26 '14 at 05:57 PM

avatar image

TheBat
51 3 6 76

avatar image DynaMesh Apr 30 '14 at 02:34 PM

Hi, thanks a lot for your explanations. I used your graph as I needed this kind of effect on my player, all is working pretty well except that each time I run this script, the character is having the rotation I want +1 or 2 extra degrees, and I can't figure out how to erase those extra degrees. So after a while running the function, the character's rotation is completely messed up.

Any idea how to fix it ? thanks a lot

avatar image TheBat May 04 '14 at 07:41 AM

Hey! Since this was something which was annoying me as well and i needed some accuracy as well i redid some work on the script and it looks entirely different now. Here's the new working solution, also with added functionality that the player cannot keep on pressing the key while the object is still rotating and it stays nicely in sync with an absolute number of degrees.

Again: Here's the blueprint!

alt text

avatar image Drakmon Mar 24 '15 at 11:43 PM

Hey, can you explain custom tick 3, My version of this stops there but when i replace it with event ticks it works. i'd be curious how to setup multiple tick calls.

avatar image max1989 Jun 29 '15 at 05:28 PM

Hi TheBat, it's a great blueprint! I'm trying to apply it to my project but can't find "SET / the current yaw" node, can you please advise where can I find it?

avatar image Shadowriver Apr 30 '14 at 02:35 PM

Use Max/Min function so calculations won't cross the target rotation

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

Set Actor Rotation will rotate object momentarily on trigger (in this case key press only once per pressed). You need to use Tick so it will trigger node on every frame and move object towards the target,also apply delta time so it it will sync with time. You need to keep target rotation in variable and set on key press and replace current key press with tick also you can block tick when rotation reach the target.

more ▼

answered Apr 26 '14 at 03:41 PM

avatar image

Shadowriver
35.9k 929 169 1105

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

Why complicate it? Define your key as an axis input and use it with an Add COntroller Yaw Input node. That is what it's designed for.

more ▼

answered Mar 25 '15 at 12:23 PM

avatar image

alperenakyuz
2k 62 24 110

(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