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"

Problem with slope angles

Hi, thanks for passing by! So i've begun setting up blueprints in order to get quake-like acceleration when in slopes. So far, it looks like in this screenshot.alt text

This is on event tick, the variable speed is fed into maxwalkspeed in another blueprint. So far, whenever my character is on a slope, he gets boosted, whatever the direction he's going in is. I'd like him to be boosted only while going downwards. I think my method is a bad one. Could anyone help me come up with a better idea?

Thanks in advance.

Product Version: Not Selected
sans titre.png (149.9 kB)
more ▼

asked Jul 18 '17 at 09:07 AM in Blueprint Scripting

avatar image

1 2 5

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

You can make dot product with (0,0,1) and impact normal I think, to get which angle/slope you have under character feet.

more ▼

answered Jul 18 '17 at 09:29 AM

avatar image

4.2k 80 16 103

avatar image TahaRizvi Jul 18 '17 at 09:31 AM

yes , exactly !

avatar image LeScorpion Jul 18 '17 at 02:03 PM

Thanks! I've never done that before, I'll try and report my results!

avatar image LeScorpion Jul 18 '17 at 05:55 PM

Hey! So i tried doing that, but it doesn't really solve my problem! I can tell if the floor is at an angle but not if the character is moving downwards or upwards, just like before!

(comments are locked)
10|2000 characters needed characters left

Hi, you will have to calculate the angle of normal vector of plane and a player character. in current situation, i guess, it won't be meeting the condition, as rotation will be constant '0' .

let me know if it works.


more ▼

answered Jul 18 '17 at 09:30 AM

avatar image

88 2 5 11

avatar image LeScorpion Jul 18 '17 at 01:58 PM

Thanks for trying to help! I know that's what I need to do, though, the problem is I don't know how to do that! Could you help me with that?

(comments are locked)
10|2000 characters needed characters left

Although this is an old question, I am posting the solution I worked out. Basically, subtract the current player position from the last player position and normalize it. That is your movement direction. Now make a dot product between the movement direction and the world up axis (for example (0,0,1)) and this gives you a value between -1(downwards) and 1(upwards). Also works for moving sidewards on a slope which gives you something close to zero (basically not moving upwards or downwards). I multiply that value with 90 and feed it into a float curve for finetuning the slope factor. For example my float curve points are (time/value) -90/2, -10/1, 10/1, 45/0.5, 50/0.

alt text

alt text

more ▼

answered Feb 03 '19 at 02:42 AM

avatar image

SoloByte Games

(comments are locked)
10|2000 characters needed characters left
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