I have a blueprint called Metal_Wheel. It’s obvious a wheel, that rotates at some AngularSpeed ( atribute or variable of the blueprint).
Then i have a Truck, which has 4 aligned wheels. Truck has a variable called LinearSpeed. Every wheel is a metalwheel blueprint.
I also have a public function in wheel that calculates its AngularSpeed from an input parameter called LinearSpeed and the radius of the wheel, so angularspeed= linearspeed/radius.
My objective is setting a linearspeed of lets say 10 in truck, reach the public function of Wheel to calculate its own angular speed. So modifying one value in truck, i could change the angularspeed of all the wheels attached ( children) of the truck. Now i have four wheels, but could be more or less…
I attach an image of what i have done, but i got an error:
Thats the idea but as you can see i cant access the public function CalculateAngularSpeed of the wheel.
Also i have created the function in truck: LinearSpeedtoWheels, what it does as the name says and commented before, spread the value of linearSpeed to all of the wheels of the truck.
Also a pic of wheel just in case:
I hope you understand my problem and sorry for my bad english.
Just to make it clearer: With linearSpeed in truck, i want to call CalculateAngularSpeed in Wheel and set AngularSpeed to the wheel. This has to be done to in this case all 4 wheels. If i put more or less wheels, it wouldn suppose a problem
Thanks in advance