Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Teleport attachment to the transform target
#2
(02-03-2022, 01:40 PM)lufydad Wrote: Hi,

I'm attachingĀ control point in runtime and I want to move the position of the control point to the position of the transform to which it is attached.
What is the simple way to move the control point from script ?

(I know it'll add a lot of kinetic energy to the rope resulting in unwanted motion)

Hi!

Not sure I understand your question. You mention "control point" instead of particles (control points are a concept that only exists in blueprints, as they are simply a construct to help define a path. At runtime all you deal with are particles, control points don't exist).

So I'm going to assume you want to do this when generating a rope blueprint programmatically:

When you call blueprint.path.AddControlPoint(); just pass in the position you want to place the control point at. Note that AddControlPoint() expects data in the rope's local space, so if you have a position expressed in the attached object's local space you will have to convert it:

object's local space-->world space-->rope's local space.

You can do this with Unity's TransformPoint/InverseTransformPoint functions.

let me know if I can be of further help.
Reply


Messages In This Thread
RE: Teleport attachment to the transform target - by josemendez - 02-03-2022, 01:51 PM