Jump to content

How to interact with terrain vegetation?


Tomas
 Share

Recommended Posts

.....
if self.camera:Pick(mousepos.x,mousepos.y,pickinfo) then
   self.picked_entity=pickinfo.entity
   if window:KeyDown(Key.L) then
   pickinfo.entity:Turn(0,Time:GetSpeed()*0.5,0)
   end
end
......

Hi is it possible in any ways to inerract with terrain vegetation, like trees? I want trees to be cuttable, is there any way to do this? I tried picking, it picks the tree but any interaction like moving, hiding, rotating wont work

Link to comment
Share on other sites

I used a variable for picking and when a cursor was on the tree it was positive, also the tree material picking flag is set. I assume that picking is possible, but is it possible to ineract like change rotation?

...
if self.camera:Pick(mousepos.x,mousepos.y,pickinfo) then
self.picked_entity=pickinfo.entity
if window:KeyDown(Key.L) then
 self.ok_picked=1
 --pickinfo.entity:Hide()
 pickinfo.entity:Turn(0,Time:GetSpeed()*0.5,0)
else
 self.ok_picked=0
end
end
...

 

self.ok_picked ws positive when cursor was on the tree

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...