Hello. I have a question. I am making a system for my game. When you hover over an actor, he should display a widget with data. The scheme of work: BP_Unit (Blue Cube) → BPC_Damageable → Attached to BPA_Damageable where in scene I have Widget.
I tried to output Particle System from BP_Unit(Blue cube) and everything works fine. I do the same with Widget(ActorHP) or Particle System (from BP_Unit) in BPA_Damageable actor and nothing works. I will be grateful for help.
I think when an actor became a component, Targeted Actor, Actor, Actor Has Tag may be incorrect in my case
So it’s better to check the class than the tag,
You can make a parent BP call it enemy, then right click and choose make child Bp
it will inherit everything from the Parent so you can do things like receive damage store health etc, and even override it in the child if the child needs more health or attacks completely different etc
Or if you wish to use has Tag i suppose that’s fine but not ideal, in class settings make sure whatever your hitting with the line trace has the tag and implements the interface,
Which it looks like you have done at least the interface part… so i would assume here that it is in fact something with the Tag…
Worth noting an Interface message like that will do nothing if the class dosen’t have the interface so you don’t really need to check if it has the tag or not
Line trace looks correct but its worth also making sure your hitting something with it, is there a square at the end of the line trace? or do a print string off of True instead of HasTag
By the parent BP you mean BP_Unit and by child BP is BPA_Damageable?
Tag and Interface are specified in BP_Unit(for Particle, for a test) and in BPA_Damageable(Widget). In BP_Unit work all good, but in BPA_Damageable with the same code i can’t get a Print String.
It looks as if everything inside the BPC_Damageabale(3 image) does not see. Perhaps need to adress the component and not to the actor
thats all a bit confusing set lets just focus on the Interface
ActorHasTag before the Interface is a bit pointless.
Interfaces are for multipurpose and ActorHasTag is to isolate one type. what i mean by that is if you only want to Target Enemys then only enemies should have the interface, or if you have different things you want to Target the Interface could return what type it is
To Target/Untarget save a Ref to the HitActor, which you have, then compare, if HitActor = CurrentTarget. Your current method will call Targetted repeatedly which may be undesireable, it will also fail to untarget if the new target is also an enemy
As I wrote earlier, I have been studying unreal for only a few months and still do not understand everything (especially in the form of text). Can you please give a more extended answer. This is the last part of a part of the project that has been bothering me for almost a week now. Thanks
id need to understand better what youre trying to do,
what is the BPA Damagable? it has no collision and wont be hit by your linetrace so you’ll never get that interface
the interface should just be only your base Actor, whether that is BP_Unit and/or Character.
if you want a more modular approach you can put that logic in your BPC_Damagable and use GetComponentByClass on the HitActor, instead of an interface call.
Solution. In Static Mesh, that calling Component disable texture, physic, and colision, then wrapped in another Static Mesh with specified texture, physic, and colision. The solution is not perfect, but it works