Announcement

Collapse
No announcement yet.

Variable from actor class?

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

    Variable from actor class?

    I have a blueprint projectile class that I'd like to use for all subsequent projectiles in my game. The projectile has several variables associated with it, one of which will be SpellDelay as a float. In my characters blueprint, I have a function that spawns the actor on click, and sets a delay for the next cast. What I'd like to do is set up the delay to be tied to the spelldelay variable in the actors blueprint. Does anyone have an idea how I can get a variable from a blueprint actor? I've tried to get the variable from Cast To, but was unsuccessful.

    #2
    Originally posted by Havoc View Post
    I have a blueprint projectile class that I'd like to use for all subsequent projectiles in my game. The projectile has several variables associated with it, one of which will be SpellDelay as a float. In my characters blueprint, I have a function that spawns the actor on click, and sets a delay for the next cast. What I'd like to do is set up the delay to be tied to the spelldelay variable in the actors blueprint. Does anyone have an idea how I can get a variable from a blueprint actor? I've tried to get the variable from Cast To, but was unsuccessful.
    Easiest way I can think of is by using a blueprint interface to send the delay as a variable from "MyCharacter" to the projectile class, but there are probably severaƶ ways to achieve what you want that may be better for your specific needs.
    Kind Regards,
    Bonny

    Comment


      #3
      You can modify variables the moment you spawn your objects; make it editable in your BP_Spell and set Expose on Spawn:

      Click image for larger version

Name:	exposed variable.PNG
Views:	1
Size:	41.1 KB
ID:	1050569

      Click image for larger version

Name:	level.PNG
Views:	1
Size:	43.3 KB
ID:	1050570

      Comment

      Working...
      X