Added BlueprintReadWrite to UProperty but property doesn't change in game when modified by a ticking blueprint

So, currently I am building a wheeled vehicle for my game and I wanted to be able to dynamically change the values of some of the things the the Vehicle Wheel classes that are used to define the wheels. So I jump through the hoops and get Visual Studio and all that up and working. I go to the Vehicle Wheel parent class, the thing that ends in .h or whatever (I don’t know anything about coding at all), and I go down to the property(s) I want to change (Suspension Max Raise, as well as a few others), and I add BlueprintReadWrite in the UPROPERTY() thing. As far as I know, thats all I needed to do. I close the UE4 editor, build my game, open things up, and it all seems to be working. Seems. I can access the properties I wasn’t able to before, but the property i’ve been trying to change doesn’t seem to be actually changing how the Vehicle Wheel class is working. There are no errors in the blueprints, I can see the variable supposedly changing when I attach a ‘Get Suspension Max Raise’ to a print node, but the changes that are supposed to happen in game, aren’t happening. I’m wondering if that Vehicle Wheel class only checks what the value of its variables are at the very start and doesn’t look again. If anyone knows how to fix this, or might have an idea of what is wrong or where I should look at the least, I’d really appreciate the help. Here are some images of the class in VS and the blueprint changing the value on tick.

Everything seems to be set up properly, from what I can tell. Can you tell/show us how you actually use the MaxRaiseValue variable? If you only read it’s value for in-game behavior once (e.g. in BeginPlay), then it obviously won’t reflect changes made to the variable. For changes to the variable to have any effect, you would need to read the value of MaxRaiseValue each tick and re-apply the variable to whatever that value does.

Cheers, Elewyth

Just wanted to add, that Blueprints do not support uint32. Blueprints can only handle uint8, int32 and float :frowning:

Well, I setup everything as you said (though I was a tad confused as to where in the WheeledVehicleMovementComponent I should put each of the thing, I just put them next to other things that looked similar). Unfortunately, the moment the MarkVehiclePhysicsStateDirty is activated, my editor crashes. I have two guesses as to why this might be.

First, I might have added what you told me to add in the wrong place. I don’t know anything about coding so its very possible I put them in the wrong place. I’ll attach screenshots of where I put them so you can see.

Second possibility: When I hover over the Vehicle Movement thing in the components of my boat blueprint, I see that it says it is Wheeled Vehicle Movement Component 4W. I don’t know if that means it is different than the one that doesn’t say 4W, or if it is just a child that inherits info from the version that doesn’t say 4W.

Here are the images of where I put the code you suggested:
The .h file

The .cpp file

If it would help, I could send you my project file.

Hey, couldn’t find a way to send you a private message here, so sent the project link to your facebook.
Edit: The folder with the current boat I am using is testshipzup4 and the wheels are in test_ship_first_skeleton as frontwheel and backwheel. Kind of a messy file system for my project atm.

Edit: For anyone viewing this, mpo tried out my project in 4.9 (vs 4.8 which is what I am using) and while it doesn’t crash, it resets all physics states, like velocity, gravity to some degree, etc. Results in the car/boat stopping mid air and slowly falling towards ground (at speed slower than it would with gravity). mpo doesn’t think this is the correct avenue to getting adjustable suspension.

Hey, just wondering, would it be possible to limit what the line trace interacts with? Was thinking that it might work out that we wouldn’t have to actually change the Suspension Max Raise if, rather, we put a collision box underneath each wheel, have them linked to the position of each individual wheel, rather than the boat body, and have the line trace only react to objects that are overlapping the collision box. The only thing I would need access to in that case is the line traces themselves in order to limit their interaction. What do you think?