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"

Linetrace for "Is Grounded", "Is Not Grounded" looping issue

So I have added a line trace to my ball so that I can trigger an "IsGrounded?" boolean variable, it works but the problem is that when the ball is rolling on the ground the console prints "Is Grounded", "Is Not Grounded", "Is Grounded", "Is Not Grounded","Is Grounded", "Is Not Grounded"... etc. If the line trace I have is going through the actor (the floor) constantly why is the boolean being changed to false?alt text

Product Version: UE 4.8
Tags:
more ▼

asked Jul 03 '15 at 04:26 PM in Blueprint Scripting

avatar image

Rotlaust
94 8 7 12

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

2 answers: sort voted first

Alright so I was able to get something finally working, but not to your suggestion. I messed around with using material hits instead of an actor. For whatever reason the floor object I had was causing weird returns on the line trace. Here is a screen shot of what I have now that has been working consistently with no issues. alt text

more ▼

answered Jul 06 '15 at 09:13 PM

avatar image

Rotlaust
94 8 7 12

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

for something like this it might be better to use a oncomponentBeginoverlap. Put the sweep result into your break hit result and get rid of the line trace. maybe even the hit result node all together.

If its alternating, it may be because the direction of the trace is changing as the ball moves? if you want to use the trace... set the debug to duration and see where each trace is hitting. if they start going off in the air.. thats why. Find a way to point them at the aground within a foot of it.. or use an overlap instead.

more ▼

answered Jul 03 '15 at 11:34 PM

avatar image

thankstipscom
654 39 38 72

avatar image Rotlaust Jul 04 '15 at 12:45 AM

I had originally had that problem with the line trace, its origin was for whatever reason outside the ball and I had no way of moving it manually so what I did was make a socket at the ball's center (it was 100 units radius so I placed it at 50) I then made the line traces origins start at the socket and made it shoot negative on the z axis. That resolved that first issue. The line trace no longer rotates with the ball, it is always shooting directly downward.

Im a bit confused at what I should try here, using a collision overlap would I not need to add a collision sphere to my ball actor? Initially I had used that but the problem is that I dont want the ball to be able to trigger "grounded" when it overlaps walls/ ceilings/players/other balls/ ect... easy enough to ignore those things but at the same time isnt a line trace more efficient? The reason I went with this method was because it was what I had used in unity on a 2.5d side scroller game. On the player actor I had shot a raycast(line trace) straight down from the players position, if the trace hit the floor it would know it was grounded and the player could jump again, otherwise it was not grounded so the jump action would be disabled. I feel like i am just missing something simple to have this work perfectly. I will try the collision method again though and see if i cant get it working that way.

avatar image thankstipscom Jul 04 '15 at 06:16 PM

The only thing I can think of why the line trace is coming back not hitting something and you're sure they always shoot downwards is if the line trace is going THROUGH the ground mesh and hitting air.

As a quick test, try this. instead of using the blocking hit from the result, clear that and leave blocking hit blank. Drag out from Return Value from the line trace and connect that to your branch instead. See if that works as is... then if not you can also try replace the line trace with a by channel instead of object. Or even a sphere trace, since it's wider you can ensure it's hitting the ground.

Also it doesn't look like your CAST is doing anything in this scenario yet.

(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