Announcement

Collapse
No announcement yet.

Ue4 Setting component position at runtime using player start & physics

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

    Ue4 Setting component position at runtime using player start & physics

    Hello forums, firstly i would like to apologize for asking a question on the forums but I am at a development impasse and cant access the answer hub. I have also asked this on stack overflow because of constant failure to sign in to answer hub no matter what I try. Here is a link to my SO question
    https://stackoverflow.com/questions/...-start-physics

    I am adding a component from a pawn cpp like this in the constructor PointEngine = CreateDefaultSubobject(TEXT("PointEngine0"));

    This class adds in multiple sub objects similar to the above snippet in its constructor, each of these sub objects apply a physics force on the pawn. The problem comes in here, the forces require position and rotation to be calculated and then set on each sub object, this is done within the PointEngine Begin Play.

    This works as it should if I drag in the pawn and simulate, however when I use player start spawn objects the points are not set in the correct location, and seem to be a good height above the player. I assumed this is because When the player drops height is offset, this seems to be confirmed by enabling physics on the spawned player after the editor starts.

    I have as a result tried moving where physics starts where points are calculated and studying documentation, unfortunately I haven't solved it for days now, I am better practiced in unity so this problem is hitting me harder than it should I think, I would appreciate any help

    Engine V4.20
Working...
X