Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extend a rope when the attached object shot from a position
#7
(28-09-2022, 07:19 AM)josemendez Wrote: Hi,

I don't see any obvious issues with your code. When are you calling AddNewControlPoint()? Its name suggests that you're adding new control points to the blueprint at runtime, which isn't the intended use case. Blueprints are generated once and used to generate one (or more) ropes, setting the blueprint of a rope will essentially destroy the rope and re-create it from scratch using the particle and constraint data contained in the blueprint. This will make your rope "jump" to a new position and shape.

If you want to change the length of a rope at runtime, you should use cursor.ChangeLength().

This is the order:

0, I have 2 controlpoints and a rope blueprint by defaultĀ 
1, raycast from the origin to the player
2, increase the rope length until reach the player with ChangeLength + update their positions, set invMass 0
3, AddNewControlPoint on the player's leg transform
4, pull up the player with the rope: invMass set Back to 10, and changeLength decrease
5, after 2 seconds I need to detach the last control point, so remove that last control point (DeleteLastControlpoint)

What is the good ordering on this? Is it possible to detach the rope after attached to something?

I need to add the last point in runtime and then just delete it...
Reply


Messages In This Thread
RE: Extend a rope when the attached object shot from a position - by lacasrac - 28-09-2022, 09:16 AM