Unable to Edit Projectile Code (FPS Tutorial)

Hi guys,

In the FPS tutorial you create a projectile class and derive a blueprint from it.

In the character blueprint, that you also make, you are told to set the Projectile class to the projectile blueprint. So far so good.

However, if I do the above, I cannot change any settings in the blueprint outside the editor (meaning in my projectile c++ class). Fx. InitialLifeSpan. If I want to change the initial life span of the projectile in my c++ (and have it affect the game), I have to change the character’s projectile class to the projectile c++ class instead of the projectile blueprint.

I’m probably missing something somewhere, and if it was just that (the life span), I guess it would be fine. However, the custom collision channel doesn’t work either. Again, I have to change collision settings in the blueprint.

Hi ,

What editor version are you currently using?

Using 4.7.

I am going to write down the steps as I understand them for clarity. Can you take a brief look and tell me if anything needs to be changed or added to the steps for reproducing this error?

  1. Open project (any blueprint based)
  2. Create a projectile blueprint
  3. In character blueprint, on the “spawn actor from class” mesh, set the class to your projectile blueprint
  4. Compile, save, close blueprint.
  5. Open the projectile blueprint’s c++ class
  6. Change a value, compile.

At this point, when I try to run the program I should experience an error, correct?

Just to make sure you are aware. I’m referring to the Epic made FPS tutorial (I believe it’s made by Epic).

Step 1) is creating an empty C++ based template.

  1. Create game mode class

  2. Create character class

  3. Derive blueprint from character class

  4. Create projectile class (Projectile class is passed as a TSubClassOf<> and declared as a UPROPERTY)

In the character blueprint you now have the option to set the used projectile to either the projectile blueprint (this is what the tutorial tells you to do. But defining variables like InitialLifeSpan inside the C++ constructor is ignored) or the actual C++ class (which is what works in regards to variables in the constructor like InitialLifeSpan. However, the projectile mesh and collision is not set up in the C++ class. It’s set up in the blueprint. So using the class it self will make you shoot “empty” (thus invisible) sphere components).

Does it make sense?

I could post screens if that might help?

Hey -

What’s happening is that the value set in code is affecting the default value of the blueprint but not the current value. Using the InitialLifeSpan as an example; when you set ‘InitialLifeSpan = 3.0f;’ in code and then compile, if you go to the projectile blueprint and check the defaults for this variable, you should see a yellow arrow to the right of the value. Clicking the yellow arrow will then update the variable in the blueprint to the default set in code. Which means if you update the code to ‘InitialLifeSpan = 5.0f;’ and compile again it will still show 3 in the blueprint until you press the yellow arrow again.

I have reported the bug of the blueprint not updating to match the code on compile (UE-11313) for further investigation by an engineer. Hopefully this information helps.

Cheers

Okay, I see. That’s definitely an issue. Playing around with the third person C++ template and the variable bUseControllerRotationYaw trying to replicate what you say.
It’s even possible to not be able to change the value (meaning, having it have an effect) in blueprints by ticking the box on and off.

This is probably an issue affecting all derived blueprints.

Thank you for your help.

Happy day :slight_smile:

/Kenneth

hehe… Still digging around. It’s also possible to have both bUseControllerRotationYaw set to false and also having unticked the use controller rotation yaw box in the blueprint… And yet… The character USES controller rotation :slight_smile:

I’ve recorded a short video displaying the error. link: - YouTube