i just got it now the difference was that i did not specify it as public, i think the compiler was seeing it as a private file that was why it was unable to readWrite to it.
public:
UMyObject();
UPROPERTY(BlueprintReadWrite, Category = "My Float")
float mainFloat;
Anyway Thank you