![]() |
Collision
Hi, This code is trying to not allow the avatar to walk through the court’s wall and balloon.
May my collision statement for avatar is wrong, but this what I have found in tutorials. HTML Code:
import viz Thanks, |
If you want a collision with the balloon to occur you will need to add a collision shape to it and enable dynamics on the avatar. You could manually check to see if the avatar is near a wall and if it is end the walking action
|
Jeff I tried with many ways; below is my modification but does not work :confused:
HTML Code:
import viz |
If you want the balloon to react to the collision you can not use the collideMesh, you'll have to use a different collide shape. Collide meshes do not react to forces. Also you have dynamics disabled on both the avatar and balloon. So you can remove these lines.
Code:
avatar.disable(viz.DYNAMICS) |
well, JEFF, I have tried to follow the gallery example in tutorial as well as your advices. the collision works around main-view and all stuff react including avatar. but the avatar responses as an object(like the balloon).(avatar still walking through the wall and balloon)
any help would be appreciated HTML Code:
import viz |
Here's an example with an avatar and a ball. You need to have collision shapes for both objects to have a collision. Your code did not have a collision shape for the avatar.
Code:
import viz Code:
viz.collision(viz.ON) If you want to stop the avatar from walking through the wall you could end the walkto action when the avatar is near the edge of the room |
HI Jeff ,Thank you very much for your help.
I cannot understand the collision in vizard although it looks very easy! :confused: I have struggled to detect the collision event by more than one way but all them did not work :mad:. I followed Farshizzo’s example on this link http://forum.worldviz.com/showthread.php?p=5599 but did not work with my code HTML Code:
def oncollide(e): Any suggestion would be appreciated! |
obj1 is the node that generated the event and obj2 is the node that obj1 collided with
|
it works fine. but i am trying to use the following lines to see the score
HTML Code:
data = viz.Data() HTML Code:
def onCollideBegin(e): |
WHat do you mean by see the score, how many collisions have occured?
I'm not sure how you are using your task function with this. |
1 Attachment(s)
Well, I have attached with this thread a sample of what I am trying to use. Indeed, I am using exactly the tasks example in vizard teacher book.
In this code you will see 2 main faults which are the collision and score (I tried many ways with the score and at then I decided to use the example, however, all ways I tried did not work):mad: Any help would be appreciated Thanks, |
All times are GMT -7. The time now is 06:04 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC