Jump to content

RPG Like Movement


EvilMax
 Share

Recommended Posts

Hi evevryone, to describe want i want to archive i have found this example:

http://www.babylonjs-playground.com/#10VR41#11

I want to create something very similar, but:

1) I would like to know if there is a way to do it without animation

2) Cast Ray at picked (with length from source to picked destination) point to check collision

Once i hove found a good example, but cant it find anymore, there was an android robot that were launching rays at mouse picked position

3) How could i perform this actions even if for example:

left mouse button is pressed (i would like to perform this action even on continuous press)

Link to comment
Share on other sites

By the way, while i use heightmap + physics, the function reported in playground, make my cube go through terrain on hills. I tried to chancge function with add ing sin and cos but sobething is keep going wong, any suggestion?

Link to comment
Share on other sites

Hi there Max,

1) does this playground help http://playground.babylonjs.com/#1NQTNE ?

2) You can create a ray (http://doc.babylonjs.com/classes/2.3/Ray) and then do a pickWithRay (http://doc.babylonjs.com/classes/2.3/Scene#pickwithray-ray-predicate-fastcheck-rarr-pickinginfo-classes-2-3-pickinginfo-)

3) You can use an event on mouse down to set a flag. In your game loop you do the action while the flag is set. On mouse up you set the flag to false.

Combined playground for 2 and 3: http://playground.babylonjs.com/#22PWBR#0

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...