25-06-2024, 10:26 AM
(25-06-2024, 09:58 AM)josemendez Wrote: That's predefined in the scene then, right? Like, your game has a set amount of levels that contain the amount of ropes and their start/end, you're only interested in storing/sending/loading the state of each rope?
You'll need to store blueprint control points as well anyway, so the start/end points of each rope will be stored in your JSON. At this point you can probably just have one scene in your game and store the entire level setup in JSON.
Sure! let me know if you need further help
Yes, because there are many ropes that need to be solved, I used an object pool to cache these ropes. But when creating ropes in advance, there is no need for specific shapes, so only the start and end points are given to temporarily fix the ropes. From a coding perspective, it is also to ensure that the blueprints created at runtime are successful, just like applying for space for positions, at least two points can represent a rope/line. Then, when facing data representing different shapes, reuse the entities of these ropes and set the positions in the blueprint. This is the final function I need.
I will try the solution you provided for me above, and if it is successful, I will come back to share the method and tell you the good news! You've made my day, sir. Have a nice day!