Obi Official Forum
Help Jump Rope - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Jump Rope (/thread-1257.html)



Jump Rope - nimdanet - 02-07-2019

Hello! 

I'm trying to make a rope jump game. I want my character to jump automatically. In unity normal process I would attach a trigger to the rope that everytime player triggers it jumps. Is it possible to achieve this into obi rope?

Thanks


RE: Jump Rope - josemendez - 02-07-2019

(02-07-2019, 12:17 AM)nimdanet Wrote: Hello! 

I'm trying to make a rope jump game. I want my character to jump automatically. In unity normal process I would attach a trigger to the rope that everytime player triggers it jumps. Is it possible to achieve this into obi rope?

Thanks

Yes, use collision callbacks and check for any particle reasonably close to your character. See:
http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html


RE: Jump Rope - nimdanet - 02-07-2019

Thanks for your reply.

I see it's possible, but kinda hard. Look at my situation:

[Image: bII60RX.png]

My rope is rotating on counter-clockwise (pink arrow)
I could check the distance from rope and player (green arrow) but this wasn't always true because I can get the same distance if the rope is behind me. To check this might be a little tricky.
The ideal solution would be to attach a unity trigger (blue box) to some of the particles. Is it possible?


RE: Jump Rope - josemendez - 02-07-2019

(02-07-2019, 01:06 PM)nimdanet Wrote: Thanks for your reply.

I see it's possible, but kinda hard. Look at my situation:

[Image: bII60RX.png]

My rope is rotating on counter-clockwise (pink arrow)
I could check the distance from rope and player (green arrow) but this wasn't always true because I can get the same distance if the rope is behind me. To check this might be a little tricky.
The ideal solution would be to attach a unity trigger (blue box) to some of the particles. Is it possible?

Hi,

You could set the position of a trigger every frame, to be that of a particle / group of particles in the rope, using actor.GetParticlePosition(index). See:
http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html


RE: Jump Rope - nimdanet - 02-07-2019

(02-07-2019, 03:05 PM)josemendez Wrote: Hi,

You could set the position of a trigger every frame, to be that of a particle / group of particles in the rope, using actor.GetParticlePosition(index). See:
http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html

That might work! I will try and back to you soon.


RE: Jump Rope - nimdanet - 02-07-2019

It worked perfectly! Thanks!