x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

(Simple Question) How do i set a vehicle wheels properties real-time

How do i set a vehicles wheel properties real-time? For example change rear wheels mass when in reverse gear.

EDIT: how do i change it from the vehicle for example vehicle->Wheels->Mass = 10.f;

Product Version: Not Selected
Tags:
more ▼

asked May 17 '15 at 08:34 PM in C++ Programming

avatar image

AndrewM47
257 67 60 77

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

In this situation you can use GetVehicleMovement() function:

 GetVehicleMovement()->Wheels[0]->Mass = 5.f;

If you like to learn more about Wheeled Vehicle Movement Component class, please go here:

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Vehicles/UWheeledVehicleMovementComponent/index.html

more ▼

answered May 18 '15 at 12:46 PM

avatar image

Andrii Melnyk
1.8k 60 19 112

avatar image AndrewM47 May 18 '15 at 01:26 PM

Yes, I tried that and it didn't work? i thought i was accessing it the wrong way?

avatar image Andrii Melnyk May 18 '15 at 01:46 PM

Please make sure that the method in which the line is placed gets called. You can use add debug message for convenience:

 GEngine->AddOnScreenDebugMessage(-1, -1, FColor::Red, FString::SanitizeFloat(GetVehicleMovement()->Wheels[0]->Mass));

avatar image AndrewM47 May 18 '15 at 02:06 PM

I just checked, It is being called and it is changing the variable but it doesn't doing anything in game. It isn't "Updating" as such, it just stays as normal? Is this a bug or something else?

(comments are locked)
10|2000 characters needed characters left

Hello, Andrew

In Vehicle Wheel class, there are special properties for this. For example, there is one for the mass:

 /** Mass of this wheel */
     UPROPERTY(EditAnywhere, Category = Wheel, meta = (ClampMin = "0.01", UIMin = "0.01"))
     float Mass;        

Thus, you can adjust it like this:

 this->Mass = 5.f;

Hope this helped!

Have a great day!

more ▼

answered May 18 '15 at 08:53 AM

avatar image

Andrii Melnyk
1.8k 60 19 112

avatar image AndrewM47 May 18 '15 at 10:27 AM

Hi, sorry i forgot to mention in the title is there a way i can edit these properties from the vehicle its self. Thanks

avatar image Sean_McIntosh Aug 02 '17 at 08:10 PM

Hello! having the same problem. Any luck figuring this out? I've been stuck for months

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question