On my ACharacter I’m instantiating a new UObject:
basicECU = NewObject();
And then I want to bind the axis and actions from the InputComponent to it, so I have:
InputComponent->BindAxis(“Gas”, basicECU, &UBasicECU::Gas);
InputComponent->BindAxis(“Steer”, basicECU, &UBasicECU::Steer);
InputComponent->BindAxis(“Strafe”, basicECU, &UBasicECU::Strafe);
Crash Error would be helpfull. I can only guess here but I assume your Object got garbage Collected. Did you make your UObject a UPROPERTY? Aside from that what does your Object creation exactly look like?
After adding the UPROPERTY() to the header, I get a EXCEPTION_ACCESS_VIOLATION (this was nullptr) whenever other functions try to access the ecu: (Basically fails earlier, when setting up some values, before binding input actions)
//Declaration on header
protected:
UPROPERTY(VisibleInstanceOnly)
UBasicECU * basicECU;