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 to make and use a curve in blueprints

Hello.

Maybe the question is not very well written. So let me explain myself.

I am making a car game demo (Think F Zero X) and I am working on the boost for the game. What I want to do is to scale the velocity by a factor that depends on the current velocity of the vehicle. So for example, if you go at 500u/s then when you go over a boost you reach 2400 u/s by simply taking 500 and multiplay the velocity vector by 4. How ever if you reach 3000u/s, then when you use the boost it shouldn't boost you too much, up to 3300, so a scale factore of 1.1.

This is a paint mock up of the curve I want to make. alt text

I know I can just draw this curve in Excel, find the trend line and apply a function in blueprints. But having a visual timeline/curve that I can edity by itself would make the tweaking process much, much easier.

This is the current blueprint I am using. As you can see, I get the velocity, then find the magnitude (POP POP!) and I can apply another function to find the appropriate scale factor to use. alt text

Product Version: Not Selected
Tags:
more ▼

asked Aug 07 '14 at 01:41 AM in Using UE4

avatar image

Motanum
620 58 63 306

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

3 answers: sort voted first

Create Curve Float blueprint, inside you can create the same graph alt text

then inside your vehicle blueprint make 1 variable CurveFloat, then assign this blueprint in, to use this just call get float and input speed inside.

alt text

graph.png (13.3 kB)
use curve.png (38.1 kB)
more ▼

answered Aug 07 '14 at 05:38 AM

avatar image

Duncan Dam
3.1k 121 50 164

avatar image DJMidKnight Aug 07 '14 at 06:11 AM

Duncan beat me to it :)

avatar image Ninjin Jun 17 '17 at 09:47 AM

You just add a new Variable with type can be Curve Float, Curve Vector or Curve Linear Color. In this case you would just use a Curve Float! <3

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

You can create a curve under miscellaneous in the create dropdown. Also if you have a maximum you could use a clamp to put a limit on the topspeed.

more ▼

answered Aug 07 '14 at 01:48 AM

avatar image

DJMidKnight
1.2k 50 24 50

avatar image Motanum Aug 07 '14 at 02:24 AM

Oh, ok. Any example as to how to use the curve once I create it?

avatar image RE-Games Jun 17 '17 at 09:52 AM

First, create a new variable in your blueprint. Set the type to Curve Float, compile the blueprint, and look at the Default Value panel.. you can choose the curve there. Then connect your variable as the Target to the Get Float Value node as shown above

avatar image SimonRail Jan 21 '16 at 05:21 PM

@motanum How did u use the Curve Float in your blueprint for your race game ?

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

alt text

better to use a pure function to get that curve. this way it won't 24/7 waste RAM on that useless reference. also do that for everything you can. pure functions are simply better than a reference as long as you need it read-only (const).

screenshot-4.png (58.7 kB)
more ▼

answered Feb 02 '18 at 03:59 PM

avatar image

Arty-McLabin
868 19 41 61

avatar image FrederickD Apr 13 '18 at 12:33 AM

I recently found out you can set a timeline's track curve to a curve asset dynamicaly, pretty powerfull..

Now i also find the 'Make InterpCurve Float/Vector/etc ' nodes... Where are these used ?

Is there a way to create a curve with this at runtime ?

I see you can add points and tangents to this... one is a curve object, the other a interp curve struct... any way to create one from the other?

avatar image roekko Aug 20 '18 at 04:15 AM

Did you figure out a way to create a curve at runtime? It seems like the InterpCurve float don't have interpolation functionality in blueprint (they do in C++) and can't be converted to a regular CurveFloat.

(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