No announcement yet.

Get variable values from picked up object

  • Filter
  • Time
  • Show
Clear All
new posts

    Get variable values from picked up object

    So I am trying to get a few variable values from objects that I pick up, with the ultimate goal to use the data in a widget that I have already set up

    I have a interface that has one method which it to determine if player is looking at object and inside the item I have a function that gets the item name that be set in the editor
    Click image for larger version

Name:	3.PNG
Views:	1
Size:	30.1 KB
ID:	1226334

    The actual part where the item is picked up looks like this
    Click image for larger version

Name:	1.PNG
Views:	1
Size:	79.4 KB
ID:	1226335 Click image for larger version

Name:	2.PNG
Views:	1
Size:	64.8 KB
ID:	1226336

    I can get the display name of the mesh from the physics object which I thought i could use as an "accessor" or I could get it through the interface method at the end, but I would have to add an output to the interface method I think?

    Any help would be appreciated, I understand that this way of doing things may be pretty bad so if there are any suggestions on other ways to do it I am very open to learning

    If I understand this correctly with your pickup event there I assume this is in your pawn, you're doing a trace, meaning that you get direct access to the actor you're tracing for. This means you already have a communication path there. You can use that to get values from that actor. You'd probably need to cast to that actor type and then you have access to any variables in there. So not sure if you do this or not but it's a good idea to have a base class for anything you can pick up, so you just cast to this to support any child actors of that class, various types of pickups.. or whatever.
    Ninja Arcade - UE4 - Forum Thread -- Ninja Arcade - UE4 - Demo v0.02a