Announcement

Collapse
No announcement yet.

How to check if an actor is another actor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to check if an actor is another actor

    Im making a even where once my actor overlaps with another specific actor (called slowdown) his gravity is set to 0 and his movement stops (basicaly levetating), but
    I only want that to happen when the player overlaps with that specific actor but i dont know how to do that.
    Basicaly, how to check if the overlaping actor is slowdown

    #2
    Drag a wire from Other Actor pin and cast to YourActor . If the cast is successful, that's the actor type you want, if it fails, that's something else.

    If you need to further identify which YourActor it is (if there's more than one), you'll need to make this actor unique in some way. This is usually done through a variable.

    Comment


      #3
      It sounds like it would be enough to check the *class* of the "other actor" and see if it equals the "slowdown". You could drag a pin off "other actor", get the class and do a comparison. You could also drag the class into a switch so you could have different behavior based on what class the other actor is (if it's a "slowdown", stop movement. If it's a "speedup", accelerate or whatever).

      I believe attempting to cast the actor as a slowdown will effectively do the same thing. It's basically saying "Try to treat this actor like it is a 'slowdown'. Did it work?"

      The last scenario I can think of is if you need to SPECIFICALLY identify that one slowdown across multiple slowdowns in the level. The easiest way to accomplish this is by using a reference to that actor .. finding that reference is harder though. It could be hardcoded in your level blueprint by selecting the actor in your level then going to blueprint and right clicking to add a reference to the placed actor. But I kinda doubt this is what you're looking for anyway.

      Comment

      Working...
      X