# playMaker

### Author Topic: how I can get distance from 2 vectors? I can only meature to object...  (Read 3357 times)

#### kyy921

• Junior Playmaker
• Posts: 50
##### how I can get distance from 2 vectors? I can only meature to object...
« on: April 27, 2012, 03:54:27 AM »
I want measure a point to the mouse pick place, I try to use distance event to do it, but distance can only measure object to object, how i can measure the distance from an vector to another??

#### kyy921

• Junior Playmaker
• Posts: 50
##### Re: how I can get distance from 2 vectors? I can only meature to object...
« Reply #1 on: April 27, 2012, 04:59:06 AM »
and~~ when i use mouse pick the surface's normal, how i can create an object follow the normal? I try to pick the suface's normal and set it to an instance's rot, but it seem not so correct

#### kyy921

• Junior Playmaker
• Posts: 50
##### Re: how I can get distance from 2 vectors? I can only meature to object...
« Reply #2 on: April 27, 2012, 05:00:48 AM »
I hope it can be generate like this

#### kyy921

• Junior Playmaker
• Posts: 50
##### Re: how I can get distance from 2 vectors? I can only meature to object...
« Reply #3 on: April 27, 2012, 05:01:49 AM »
but it just like this

#### kyy921

• Junior Playmaker
• Posts: 50
##### Re: how I can get distance from 2 vectors? I can only meature to object...
« Reply #4 on: April 27, 2012, 05:03:05 AM »
the rot value is picked, but I dont think its the right number.
......
help..... T T

#### Iwa

• Playmaker Newbie
• Posts: 6
##### Re: how I can get distance from 2 vectors? I can only meature to object...
« Reply #5 on: April 27, 2012, 05:05:03 AM »
For your measure : One solution is to use the action Vector Substract and then Get Vector Length . I'm not a pro, so here is my little idea

Mess with the best, die like the rest

#### kyy921

• Junior Playmaker
• Posts: 50
##### Re: how I can get distance from 2 vectors? I can only meature to object...
« Reply #6 on: April 27, 2012, 08:39:24 AM »
thank you! I will try

#### jeanfabre

• Hero Member
• Posts: 14119
• Official Playmaker Support
##### Re: how I can get distance from 2 vectors? I can only meature to object...
« Reply #7 on: April 27, 2012, 12:02:31 PM »
Hi,

For getting the normal and have an game object follow it, i did a working example a while back on this forum, can't find it, but will search better and give you the link asap

For distance, iwa is correct, to get a feel for vector operation, simply google for it, and then apply this with the actions provided, there is little you can't do with playmaker on that matter.

Bye,

Jean

#### kyy921

• Junior Playmaker
• Posts: 50
##### Re: how I can get distance from 2 vectors? I can only meature to object...
« Reply #8 on: April 27, 2012, 10:14:14 PM »
really thank you !