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"

Is there a way of removing the easing from the Rinterp node?

I want to rotate something to look at something else but I want it to be a linear movement. Is there a very simple way of doing this? or do you have to write your own little custom graph? the Rinterp node is so almost perfect.

Product Version: Not Selected
Tags:
more ▼

asked Sep 22 '14 at 05:12 PM in Blueprint Scripting

avatar image

Asher S Einhorn
650 94 80 182

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

3 answers: sort voted first

I am not sure if you can change Rinterp, but it's rather easy to make what you want. I am not at my PC right now so I can't show you a blueprint but it should go like this:

Start with Event Tick, connect to SetActorRotation. Then i am not sure how you want to have it specifically, but you need to use delta seconds output in Event Tick and and your desired rotation to calculate the rotation on each tick.

It should go something like this: NewRotation=(RotationSpeed*DeltaSeconds)+CurrentRotation Then set NewRotation to SetActorRotation

It's just a framework and I am not sure if this is specifically what you have and want, but it should be rather simple to figure out.

more ▼

answered Sep 23 '14 at 11:11 AM

avatar image

Algirdyz
143 11 12 18

avatar image Asher S Einhorn Sep 24 '14 at 11:43 AM

It doesn't actually end up being as simple as you would hope. the problem is not simply applying linear rotation but checking if you're at the target rotation and not overshooting. There is an additional problem in that you have to 'wrap' this calculation from -180 to 180. I did it in the end, but I'm going to get someone else in my studio to check it's the simplest solution before posting.

avatar image Pierdek Sep 24 '14 at 06:17 PM

This function is already implemented in the engine, but not exposed to BP:

 CORE_API FRotator FMath::RInterpConstantTo( const FRotator& Current, const FRotator& Target, float DeltaTime, float InterpSpeed )
 {
     // if DeltaTime is 0, do not perform any interpolation (Location was already calculated for that frame)
     if( DeltaTime == 0.f || Current == Target )
     {
         return Current;
     }
 
     // If no interp speed, jump to target value
     if( InterpSpeed <= 0.f )
     {
         return Target;
     }
 
     const float DeltaInterpSpeed = InterpSpeed * DeltaTime;
     
     const FRotator DeltaMove = (Target - Current).GetNormalized();
     FRotator Result = Current;
     Result.Pitch += FMath::Clamp(DeltaMove.Pitch, -DeltaInterpSpeed, DeltaInterpSpeed);
     Result.Yaw += FMath::Clamp(DeltaMove.Yaw, -DeltaInterpSpeed, DeltaInterpSpeed);
     Result.Roll += FMath::Clamp(DeltaMove.Roll, -DeltaInterpSpeed, DeltaInterpSpeed);
     return Result.GetNormalized();
 }

avatar image qewo Sep 25 '14 at 05:41 PM

How would i expose this to BP? i looked at creating a custom blueprint node but as this is CORE_API i'm not sure if it would work.

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

Use the RInterpToConstant node.

more ▼

answered Dec 08 '14 at 02:17 PM

avatar image

MulleDK19
2.7k 161 274 254

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

Simply rotate the object by the time. If you know the angle and the System FPS, then you can calculate the amount of rotation per process tick, which creates a smooth rotation to the target.

more ▼

answered Sep 22 '14 at 05:25 PM

avatar image

yRezaei
319 12 9 36

avatar image Asher S Einhorn Sep 22 '14 at 06:57 PM

There's so much in this answer that I don't know how to do. Can you provide an example of how I would do that?

avatar image Asher S Einhorn Sep 23 '14 at 10:38 AM

also this isn't an answer to the question, but thanks anyway.

(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