I am trying to cast a Line using an ActorCompnent towards the owner of the component and print the name from anything that collides with it.
It keeps printing “None” which would suggest that the line tracer simply doesn’t find anything, which would be weird. But it does report that it finds something.
Can anyone help me with this?
I do not know about the layout of your scene. But I have two suggestions, the first one is that reviewing the collision presets and be sure the blocking will raise, the second one is to check the RayLength if realy what you want. (RayLength = 100 means 100cm not 100m)
Ah… You supposed that the BoneName is none which is weird? I misunderstanded before. The BoneName is none here should be normal. Because there is just a StaticMeshComponent rather than SkeletalMeshComponent. If you want which object was hit, you could refer the Actor field in FHitResult, and Hit.GetActor().GetName() for the object’s name. Or you could use the return value of ActorLineTraceSingle method to judge if the hit was raised.