#The mesh component in the actor has

1 messages · Page 1 of 1 (latest)

thin reef
#

My trace channel is set to visibility, and these are my collision settings for the mesh component of the object I am interested in:

timber pond
#

What type of collision is this, simple or complex?

#

Does the parent component have collision enabled?

thin reef
#

Could you clarify what you mean on both fronts? I apologize, I'm a novice when it comes to Unreal Engine. The parent blueprint that static mesh is a part of has these collision settings:
None of the tutorials with which I was interacting mentioned needing to set up collision channels or defining simple or complex collision.

timber pond
#

set that and see where your trace line is going, tell me if its correct

thin reef
#

looks like it's going in the spot I'm looking but is rather weird; i looked to the right and then down

timber pond
#

That doesnt look right at all lol

thin reef
#

This is how I'm determining the line trace position; this should just be a very long vector coming out in front of the first person camera right?

timber pond
#

Is something wrong with the first person camera?

timber pond
#

The code looks good. But something is wrong with that camera

thin reef
#

I didn't mess with the camera at all; it should just be the default camera from the first person blueprint

timber pond
#

Do you have any other camera components?

#

Or any code that manipulates the camera?

thin reef
#

Not that I'm aware of! I attached the gun to the arms but that's the only change I made

timber pond
#

take a picture of your components list

thin reef
#
  1. first person blueprint
  2. thing I am trying to have people look at to trigger something
timber pond
#

Im a little at a loss. Maybe your arms or capsule is hitting the trace instead. Its hard to pick it apart without being able to investigate deeper. Did you print to screen the object the trace channel returned like I suggested earlier?

thin reef
#

Yes I did, it doesn't return anything if I do that. Nothing is being returned. It actually looks like the line trace is working properly - it's shooting out long lines in front of the character. It's just that for whatever reason, those lines aren't interacting with anything

timber pond
thin reef
#

Like the tutorial I was following? https://www.youtube.com/watch?v=GXcGAvik2cc trying to adapt this to suit my purposes.

Hey guys, in today's video, I'm going to be showing you how to create a system in which the name of the object you are looking at, will appear on screen. This is to inform the player of what item they are looking at, or can interact with.

#Ue4 #UnrealEngine4 #Ue4Tutorial
__________________________________________________________________________...

▶ Play video
#

I don't need to display a name or anything, all I need is for the player looking at this object for 500ms to trigger a custom event that destroys the object and starts the next part of the code. I was just using this tutorial to understand how to get where the player was looking.

timber pond
#

Gotcha

thin reef
#

If you have any other thoughts on how I could do it I would be extremely grateful.

timber pond
#

Im sure its a silly checkbox somewhere that got unchecked. Without access im not sure I can find it. Maybe if u post a video with all your setup, settings, code and showing the line traces. Otherwise im not sure where to go from here. Unless someone else has an idea.

glass girder
#

those lines are weird and it doesn't look like they hit anything

#

but the trace looks legit

#

from the center out forward

thin reef
glass girder
#

look at the trace and take a picture of it

#

to see if it goes through anything

thin reef
#

It turns green when it's touching my object of interest, and green is the trace hit color

timber pond
#

from camera perspective it should look like this

glass girder
timber pond
#

lol wait

#

Is this in the level?

thin reef
#

Yes that's the object I'm looking at, it's in the level. For now, I just want to print hello when the trace hits that object.

glass girder
#

so print something on false

#

see if that shows up

#

i would also check if it's blocking first

thin reef
glass girder
#

so the comparison isn't working

glass girder
thin reef
glass girder
#

right but does it print when your looking at the thing ?

thin reef
#

No it doesn't, that's the problem we are trying to solve. If I can get it to do that I can set up the rest of my code to call an event and do what I need to do from there, I think.

glass girder
#

well the line trace is working

#

your comparison isn't working

timber pond
#

I just recreated this in my project and its working as intended

thin reef
#

What could I have done wrong? The trace turns to a square when it hits the object I am interested in and it changes to a green line on the other side of it.

timber pond
#

Just do this and see what its printing out

timber pond
# timber pond

Back to this, you cannot just do this. Its not a valid reference. What you want to do is instead compare based on class type.

thin reef
#

damn, this worked

thin reef
timber pond
#

Nice!

glass girder
timber pond
#

You cannot compare the HitActor to this object reference. Its not a valid reference. You have to find a valid reference or compare by class type.

thin reef
glass girder
timber pond
#

Do what engage said because its way better for performance too

timber pond
glass girder
#

you could also cast

thin reef
#

Nevermind, thank you! The problem is that the way it's set up, you have to look off of the object before the timer to destroy it starts.

#

I have it like this for my other object to do what I want which is basically the same thing except shooting it with a laser beam. Final question - why is this one behaving like that whereas begin overlap works the way I want? I would like the timer to start when the trace hits this object and continue as long as the trace is hitting the object, otherwise it should be reset

glass girder
#

you destroy self on that event, how do you want it to keep working ?

thin reef
#

Sorry; what I would like is if the trace hits that object for more than 0.5 seconds, the object is destroyed. If the trace moves off of the object in that time, the timer is reset. That's the logic I built for this other blueprint I'm using that I showed you above, but it looks like the line trace doesn't work the same way as BeginOverlap.

#

The way it is currently working, the object is destroyed after 0.5 seconds only after the trace has hit the object and then moved off of it.

glass girder
#

well i don't see a trace here, your using overlap

thin reef
#

Sorry. That image is a different blueprint doing a different thing.

#

This image here is what we have been working on. I was just showing that other blueprint to show you how I am trying to set this one up

glass girder
thin reef
#

I am trying to understand why this one only destroys the object if you hit it and then move away from it as it is currently structured.

glass girder
thin reef
glass girder
#

maybe a do once with a reset after the timer goes off

#

and also on false you can reset it

#

i like a boolean for things like this but do once might work

#

also check for a blocking hit before you start using the hit actor

#

if you don't hit anything it will probably throw

thin reef
#

It's the same problem if you do it with a do once with a reset - the problem is that the timer starts once you hit the object, then move the cursor off of the object, and I don't understand why.

glass girder
#

i was saying do once on the timer, and you should clear and invalidate on false

#

and non blocking

#

so that it starts when you first hit the object and doesn't keep creating timers

#

and your clear and invalidate isn't hooked up to anything, it should be run when you don't hit the actor you want

#

so the way you have it once you "see" this object, it will be destroyed in 0.5

#

but the do once you have is in the wrong spot

thin reef
#

yep this works, thank you so much! I don't understand how the do once is helping differently than how I had it though. the clear and invalidate of course needed to be hooked up.

glass girder
#

i would make the reference and just use that instead of that weird wire going across nodes

#

and also check for blocking so it doesn't crap out if you hit "nothing" but if it works then thats good

thin reef
#

Thank you as always!

glass girder
thin reef
glass girder
#

right and i'm pretty sure the variable that your clearing would just be newest one