Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make the Start/End Prefab able to be Raycasted?
#4
(30-10-2017, 03:37 PM)Rexima Wrote: I have an First Person Character Controller, if i make any proximity checks with the character, than it wont work like expected.
My Player need to aim at one End, the End should be Outlined and than if he press an button, the end is in his "hands".

I hope you know what i mean. The player needs to take the rope and connect it with an Entity, so i need to let him grab one End.

Edit: I was lil bit stupid... I just attached my Pickup and Outline Script on the Start/End prefabs and now its working. (So now im able to create an handle at the right position) But to grab the Rope i need to create an ObiParticleHandle, right?
Is there any good sample / tutorial, how to grab it?
I managed to move the handler, but the rope is still on the ground. Do i need to pin the rope end to the handle?

Yes, you need to create a ObiParticleHandle. All of this is in the manual, scripting section. You can either create a handle:

Code:
// Create the handle:
GameObject c = new GameObject("Obi Handle");
ObiParticleHandle handle = c.AddComponent<ObiParticleHandle>();
handle.Actor = actor;

c.transform.position = /*position the handle here*/;

// Add the selected particle(s) to the handle:
handle.AddParticle(i,/*position of the particle in world space*/,actor.invMasses[i]);


Or use the low-level API to fix the particles in place and move them around yourself. Handles are just a fancy way to move particles around using a transform, but in some cases (like this one) you can just move the particles directly yourself. The sample code in the manual (under "setting particle properties") does exactly this:
http://obi.virtualmethodstudio.com/tutor...icles.html
Reply


Messages In This Thread
RE: How to make the Start/End Prefab able to be Raycasted? - by josemendez - 30-10-2017, 04:41 PM