Vehicle question. How to remove the vehicle.

Everything related to 3D programming
User avatar
minimy
Enthusiast
Enthusiast
Posts: 619
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Vehicle question. How to remove the vehicle.

Post by minimy »

Hello, im making code with any vehicles and work good. The problem is when need remove one from the scene.
Any way to remove any vehicle? because i cant see any comand to do this... like 'freeVehicle' or any similar thing.
Is possible?
If translation=Error: reply="Sorry, Im Spanish": Endif
User avatar
jacdelad
Addict
Addict
Posts: 2010
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Vehicle question. How to remove the vehicle.

Post by jacdelad »

The vehicle is an entity, you can remove it via FreeEntity(), see CreateVehicle: https://www.purebasic.com/documentation ... hicle.html.
Plus:
The new created vehicle is a regular entity, so all entity functions can be used to manipulate a vehicle.
https://www.purebasic.com/documentation ... index.html
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
minimy
Enthusiast
Enthusiast
Posts: 619
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Vehicle question. How to remove the vehicle.

Post by minimy »

Hello jacdelad! thanks for your help.
If remove car chasis and wheels (because i not see more entitys), of one of the two cars in the scene the program crash.
I put some conditions to see if was calling an entity removed, but not.
Goto use pivot to have more control over objects in the game.
Thanks and have nice day!
If translation=Error: reply="Sorry, Im Spanish": Endif
Post Reply