CarXTechnologies / dro-map-uploader

Project for Steam Workshop modded maps upload
11 stars 3 forks source link

Rigidbodies #34

Open b7ackstudio opened 4 weeks ago

b7ackstudio commented 4 weeks ago

i test and rigidbody for me not work i need mesh colider , box colider ? game market data? to work with rigidbodies ? i try to make hinge joint and not work

Jeefrect commented 3 weeks ago

It works for me. I hope this Unity file will help you Bumper.zip image

b7ackstudio commented 3 weeks ago

It works for me. I hope this Unity file will help you Bumper.zip image

I put it on the map rigidbodies on object , in game is ok - its moved but not restart , for u this work ?

Jeefrect commented 3 weeks ago

It works for me. I hope this Unity file will help you Bumper.zip image

I put it on the map rigidbodies on object , in game is ok - its moved but not restart , for u this work ?

Need a script that will return objects to their default positions. There is no such script now, but it should appear in the next SDK updates maybe~~

Mankeysocks commented 1 week ago

Hello everyone,

I'm reaching out to see if anyone can shed some light on your bumper.zip file after I tinkered with adding a reset script. I included ValidItemData in ModMapTest.cs with a new entry: ValidItem(nameof(SimpleAutoReset), 0, 100), which allowed me to build in Unity with the script attached to the bumper on the Rigidbody.

However, while the script works perfectly in the editor, it doesn't seem to function in-game. I've also added a tag just in case. Any insights or suggestions would be greatly appreciated!

SimpleAutoReset.zip

Thank you!

Mankeysocks commented 1 week ago

here was my old editor debug no its not 100% but was POC SimpleAutoReset_debug1.zip

Jeefrect commented 1 week ago

SimpleAutoReset.zip

When you create an AssetBundle in Unity (build the map), it can contain data such as textures, models, materials, sounds, prefabs, and other assets, but it cannot contain executable code. This limitation is due to both security concerns and Unity's architecture.

If an object in an AssetBundle has a script attached to it, the object will remember which script was attached, and the values of any serializable fields (for example - public fields or fields marked with [SerializedField] in private) will be saved. However, the actual script code is not included in the AssetBundle.

For the script to work, the following conditions must be met:

ValidItemData in ModMapTest.cs

There's no real point in modifying scripts in the SDK, such as adding new parameters or changing existing ones in ModMapTest.cs. The reason is that when your map is loaded into the game, the game itself also runs checks on all these parameters from ModMapTest.cs. Even though your changes might work in the Unity editor, they won't function in-game unless the game has been updated to recognize and handle those changes. This is likely why your script works in the editor but not in the game—because the game isn't aware of the new parameter you've added.

In short, any changes to scripts in the SDK, especially for in-game functionality, need corresponding updates on the game's side for them to work properly.

Mankeysocks commented 1 week ago

thanks for rply that was my hunch was just attempting work around