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"

Cover system on curved surfaces

Hi! I have been working on a cover system and gotten quite far. However I have run into a problem. I use linetraces to find a cover and use the hit location to set the characters position and the hit normal to set the rotation. The character can also move along the surface as it should. While in cover the character shoots a linetrace, with the opposite direction of the latest cover normal, every frame. The hit information updates the rotation and position ever frame. However a problem emerges when taking cover behind convex surfaces. When the character reaches the edge of a face and hits a new face, it changes the rotation to align with the new face. But with this new rotation the next linetrace hits the old face so the rotation is set back. So the rotations switch between to values at 60 fps so the character starts jittering. I hope I managed to explain sufficiently the problem that I am facing. I have been trying to solve this for a long time but haven't been able to solve it yet. Does anybody have any smart suggestions? thanks for your time :)

Product Version: UE 4.13
Tags:
more ▼

asked Apr 28 '17 at 03:54 PM in Blueprint Scripting

avatar image

Kurtaa1
30 2 7 6

avatar image Two-faced Apr 28 '17 at 04:36 PM

It's very hard to understand your problem without screenshots. At least one with rotation setting and hit calculation

avatar image Kurtaa1 Apr 29 '17 at 02:23 PM

alt text alt text

capture2.png (149.3 kB)
capture4.png (144.0 kB)
capture5.png (500.2 kB)
avatar image Two-faced Apr 29 '17 at 02:44 PM

The problem could be at the trace start and end. Show us more)

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

2 answers: sort voted first

try RinterpTo, instead of instantly turning. use more than one trace, then average the results.

more ▼

answered Apr 28 '17 at 11:55 PM

avatar image

ScottSpadea
9.6k 318 205 449

avatar image Kurtaa1 Apr 29 '17 at 02:21 PM

The way I see it, an average would just minimize this problem not fix it. The undesired effect would still be noticable. RInterpTo did not help at all

avatar image Kurtaa1 Apr 29 '17 at 02:46 PM

Hi, I managed to get a decent result when using RinterpToConstant by using the velocity as a factor in the interp speed. It didn't work before because of another part of the code which I changed. Thank you for the help! :)

avatar image Two-faced Apr 29 '17 at 02:52 PM

I'm not sure it helps you every time.

avatar image Kurtaa1 Apr 29 '17 at 03:13 PM

when would it not?

avatar image Two-faced Apr 29 '17 at 03:18 PM

On sharp egdes

avatar image Kurtaa1 Apr 29 '17 at 04:14 PM

I doesn't need to work on any angle that is sharper than 70 degrees or so. since that would count as the edge of the cover.

avatar image Two-faced Apr 29 '17 at 04:32 PM

You didn't say that)

avatar image Kurtaa1 Apr 29 '17 at 04:55 PM

no sorry about that. That is usually how cover system work though.

avatar image Two-faced Apr 29 '17 at 04:59 PM

whatever) hope you never stuck in your work. good luck!

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

While we check your code I could help you with common logic. When the character finds angle by casting traces and checking normal changes, you should change not only rotation but location to. Move character to new snapping position. And while you so that skip normal checking.

more ▼

answered Apr 29 '17 at 02:48 PM

avatar image

Two-faced
842 31 12 47

avatar image Kurtaa1 Apr 29 '17 at 03:11 PM

I did try that earlier but it did not work for some reason. Furthermore this would require the the location to be changed instantly which would not look good at all, or it would have to change the rotation and location at exactly the same rate which I suspect could cause bugs. Thank you for your reply but I believe it to be solved :)

avatar image Two-faced Apr 29 '17 at 03:20 PM

Why instantly?? Move by spline with Interp. And I advise you skip rotation checking until you move around corner.

avatar image Kurtaa1 Apr 29 '17 at 04:17 PM

the solution I have now allows me to change the rotation and the location simultaneously which looks alot more fluid than changing one after the other.

(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