#The mesh component in the actor has
1 messages · Page 1 of 1 (latest)
My trace channel is set to visibility, and these are my collision settings for the mesh component of the object I am interested in:
What type of collision is this, simple or complex?
Does the parent component have collision enabled?
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.
looks like it's going in the spot I'm looking but is rather weird; i looked to the right and then down
That doesnt look right at all lol
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?
Is something wrong with the first person camera?
yes
The code looks good. But something is wrong with that camera
I didn't mess with the camera at all; it should just be the default camera from the first person blueprint
Not that I'm aware of! I attached the gun to the arms but that's the only change I made
take a picture of your components list
- first person blueprint
- thing I am trying to have people look at to trigger something
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?
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
Can you send me the link to the tutorial?
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
__________________________________________________________________________...
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.
Gotcha
If you have any other thoughts on how I could do it I would be extremely grateful.
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.
shoot a trace and then f8 out and look where it's going
those lines are weird and it doesn't look like they hit anything
but the trace looks legit
from the center out forward
What do you want me to do once I F8 out?
It turns green when it's touching my object of interest, and green is the trace hit color
so the trace is working and hitting, so what are you doing on hit ?
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.
so print something on false
see if that shows up
i would also check if it's blocking first
It prints every tick, yes
so the comparison isn't working
it prints if your looking at the object ?
No, if you print on false, it prints every tick.
right but does it print when your looking at the thing ?
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.
I just recreated this in my project and its working as intended
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.
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.
damn, this worked
I have run into this problem before, thank you for your help and you as well @engage. Can you explain to me why what I did before didn't work?
Nice!
you could also just get actor of class, single and use that instead of get all and get 0
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.
becayse that object reference is not a specific instance of that object?
you can also get the actor on beginplay and use that reference
Do what engage said because its way better for performance too
Right its an invalid object and not a matching object instance.
you could also cast
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
you destroy self on that event, how do you want it to keep working ?
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.
well i don't see a trace here, your using overlap
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
so if you wanted it similar, then probably on false clear and invalidate the timer, promote it to variable and use the reference
That's what I figured. The problem is that for some reason this one only starts the timer after you have hit the object and then moved off of it. SO if you then do the false and invalidate, it never destroys it.
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.
well your just starting a bunch of timers, because this runs on tick right ?
I would rather it didn't but I can't think of another way to be checking for when the player focuses on this object.
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
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.
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
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.
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
Thank you as always!
think about how often tick goes off, and everytime that code runs it creates a new timer
ohhhhhhh sure! Thank you for explaining!!!! Do once makes sure that a new timer isn't being made every tick until you have looked away again. Got it.
right and i'm pretty sure the variable that your clearing would just be newest one