henrym01
asked on
Lingo Error: 3D cloned object...
Hi Experts, Was wondering if you could help.............
I have created a 3d scene and cloned a character in from the cast, this character is able to navigate around the screen, however im attempting to make it so when it walks into the blocks they will be solid, i added a collision code to try but get a error on the pMouse lines, yet recieve the error:
-------------------------- ---------- ---------- -----
Script error: Object expected
pMouse.addmodifier(#collis ion)
-------------------------- ---------- ---------- -----
Does anyone know how to fix this so it relates to a model cloned in?
To clone the model i used:
-------------------------- ---------- ---------- -----
pMouse = pMember.cloneModelFromCast member("mo use", "mouse", member("mouse"))
pMouse.transform.scale = vector(0.2,0.2,0.2)
pMouse.transform.rotation = vector(0,90,0)
pMouse.transform.position. y = -10
pMouse.transform.position. x = 80
pMouse.transform.position. z = 40
-------------------------- ---------- ---------- -----
then to detect collision i tried the following:
-------------------------- ---------- ---------- -----
-- add collision modifier to the "wall"
pMember.model("block").add modifier(# collision)
-- set bounding geometry for collision detection to bounding box of model
pMember.model("block").col lision.mod e = #box
-- resolve collision for wall
pMember.model("block").col lision.res olve = TRUE
-- i get the error on the following line
-- add collision modifier to the character
pMouse.addmodifier(#collis ion)
-- set bounding geometry for collision detection to bounding box of model
pMouse.collision.mode = #mesh
-- resolve collision for character
pMouse.collision.resolve = TRUE
end
-------------------------- ---------- ---------- -----
Thank You
I have created a 3d scene and cloned a character in from the cast, this character is able to navigate around the screen, however im attempting to make it so when it walks into the blocks they will be solid, i added a collision code to try but get a error on the pMouse lines, yet recieve the error:
--------------------------
Script error: Object expected
pMouse.addmodifier(#collis
--------------------------
Does anyone know how to fix this so it relates to a model cloned in?
To clone the model i used:
--------------------------
pMouse = pMember.cloneModelFromCast
pMouse.transform.scale = vector(0.2,0.2,0.2)
pMouse.transform.rotation = vector(0,90,0)
pMouse.transform.position.
pMouse.transform.position.
pMouse.transform.position.
--------------------------
then to detect collision i tried the following:
--------------------------
-- add collision modifier to the "wall"
pMember.model("block").add
-- set bounding geometry for collision detection to bounding box of model
pMember.model("block").col
-- resolve collision for wall
pMember.model("block").col
-- i get the error on the following line
-- add collision modifier to the character
pMouse.addmodifier(#collis
-- set bounding geometry for collision detection to bounding box of model
pMouse.collision.mode = #mesh
-- resolve collision for character
pMouse.collision.resolve = TRUE
end
--------------------------
Thank You
ASKER
any code example please?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, its better to use a dummy box for collisions. Its far faster and more accurate. Also, Director's built in collision is poor at best. You might consider havok or ray casting instead.