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"

Align character to floor angle.

Hi, I've been trying to make a 360 movement player (360 movement being that he can move like Sonic) however I've faced a problem. I've reached the point at which the player correctly sticks to the ground plane he is on however it only works if he is on a ground plane that is less than 90 degrees.

Let me explain how i managed to make this, basically i set the movement mode of the player to flying, i created custom gravity using force, and for the gravity direction, i set the gravity to push the player onto the plane he is on (basically rotate the gravity to match the player's rotation). I used this for the floor detection:

alt text

It worked fine until i reached a plane that is steeper than 85-90 degrees, the player instead of rotating to stand on the plane rotates the other direction.

I have provided a video so you can see what i mean: https://youtu.be/Hipk_znel38

The clip in the video was slowed down so you can see better the rotation of the player at the top left.

Is this happening because of the rotation code or is it happening due another thing?

I'm pretty bad at vector and rotation math so I really need help with this...

Thanks in advance!

Product Version: UE 4.14
Tags:
more ▼

asked Dec 04 '16 at 09:27 AM in Blueprint Scripting

avatar image

Yiannis1
18 6 6 10

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

2 answers: sort voted first

Never mind, after a lot of searching i found the answer in this answer hub, i have no idea why it was so hard to come by however here is the link if anybody else needs the same question answered. The player now correctly stays on the ceiling. https://answers.unrealengine.com/questions/172027/tilting-character-to-surface-lost-in-vector-math-h.html

more ▼

answered Dec 04 '16 at 11:34 AM

avatar image

Yiannis1
18 6 6 10

avatar image A GUPTA Dec 04 '16 at 04:01 PM

It was a thread started by KITATUS. Please do have a look. Glad U found an answer but still surely have a look.

avatar image Yiannis1 Dec 04 '16 at 04:12 PM

I actually am, the link you posted looks very interesting!

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

this might help. https://forums.unrealengine.com/showthread.php?57376-Dynamic-gravity-for-characters Actually with BP only I don't know whether it is possible . There is a whole thread dedicated to this but i am sorry i do not remember who started it or what its name was . if I remember I shall post the thread link too.

more ▼

answered Dec 04 '16 at 11:08 AM

avatar image

A GUPTA
4.1k 102 46 617

avatar image Yiannis1 Dec 04 '16 at 11:18 AM

I think it is possible via blueprints only. But the only problem now is that when the impact normal Z becomes negative, the code in the picture above adjusts the player rotation as if the Z is positive. You can see this in the video i provided. I just need a way through blueprints to align the player to the normal of the plane he is on.

(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