x


Click to move Diablo Style

Hello everyone. I'm trying to implement a 'Click to Move' to a capsule. Is there any script for this particular type of movement? As the style of Diablo

more ▼

asked Nov 20 '10 at 11:02 AM

stefano gravatar image

stefano
23 2 2 6

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

you can find the script you seek (and much, much more) on Unity Wiki http://www.unifycommunity.com/wiki/index.php?title=Scripts

more ▼

answered Nov 20 '10 at 12:39 PM

Bravini gravatar image

Bravini
1.1k 6 11 29

Thank you very much :)

Nov 20 '10 at 09:47 PM stefano
(comments are locked)
10|3000 characters needed characters left

1) first you use ray casting to detect the Hit point of the terrain.
2) Then you use a transform.LookAt(); to face the player in the right direction;
3) then you do a transform.Translate(Vector3.forward); to move towards the point.

You have to make sure the Y- is correct other wise you ll keep walking into the ground.

more ▼

answered Nov 20 '10 at 11:35 AM

denewbie gravatar image

denewbie
732 3 3 17

(comments are locked)
10|3000 characters needed characters left

Check the "Moving on Uneven Terrain" at the ITween website. You can use his documentation for using the library. http://www.pixelplacement.com/itween/examples.php

more ▼

answered Nov 20 '10 at 12:22 PM

diabloroxx gravatar image

diabloroxx
689 5 7 12

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1425
x1001
x19
x12

asked: Nov 20 '10 at 11:02 AM

Seen: 9609 times

Last Updated: Nov 20 '10 at 11:02 AM