There is a fundamental part of Blueprint scripting that should allow an Actor’s attributes to be set but I am unable to find it. Most specifically, how do I set the gravity value of an Actor Blueprint in a script after an event?
For further information, the Blueprint has a sphere inside it that I would like to set the gravity value of. I am unable to find a way to do this.
Howdy!
There are a couple posts about how to set gravity here on AnswerHub, just depends on how you want to use it.
Here’s one for character gravity:
Here’s one for projectile gravity:
Let us know if you have further questions,
-W
Thanks for getting back to me; I have read those previous questions but they relate specifically to a player character, presumably linking through to a user-defined variable.
The difficulty I am finding is the ‘syntax’ on accessing the attributes of a component, I’m unable to find any standard methodology to accomplish this. Every example seems to approach it differently and there does not appear to be any consistency.
Has taken a while but came back to this the other day and have resolved it.
The static mesh component needs to be retrieved which allows for the physics options to be set; sounds so simple but one of the issues I am having, especially at the start, is knowing the path to access each of the values available.
In summary, I have
- a level blueprint that checks for Overlap between the two objects
- a custom event is called in the blueprint of the object to active gravity
- in the object’s blueprint, I retrieve the static mesh component and call Set Enable Gravity