Professional Web Applications Themes

cloneModelFromCastmember and addChild - Macromedia Director 3D

Hi I am creating the bollowing game using havok. In the game i am creating 10 pins by cloning the castmember "pin" as well as 10 cylinders by cloning the castmember "cylinder" and then positioning it. The cylinders i am using as a proxyobject to detect collisions. the cylinders are the movableRigidBodies and the pins r for the display purpose. After cloning the cylinders i have to addChild the pins with the cylinders but it wont work preload member "pin" preload member "cylinder" member("my3d").cloneModelFromCastmember("pin1", "pin", member("pin")) member("my3d").cloneModelFromCastmember("cylinder1 ", "cylinder", member("cylinder")) repeat with i=2 to 10 member("my3d").model("pin1").clone("pin" & i) member("my3d").model("cylinder1").clone("cylinder" & ...

  1. #1

    Default cloneModelFromCastmember and addChild

    Hi
    I am creating the bollowing game using havok. In the game i am creating 10
    pins by cloning the castmember "pin" as well as 10 cylinders by cloning the
    castmember "cylinder" and then positioning it. The cylinders i am using as a
    proxyobject to detect collisions. the cylinders are the movableRigidBodies and
    the pins r for the display purpose. After cloning the cylinders i have to
    addChild the pins with the cylinders but it wont work

    preload member "pin"
    preload member "cylinder"
    member("my3d").cloneModelFromCastmember("pin1", "pin", member("pin"))
    member("my3d").cloneModelFromCastmember("cylinder1 ", "cylinder",
    member("cylinder"))

    repeat with i=2 to 10
    member("my3d").model("pin1").clone("pin" & i)
    member("my3d").model("cylinder1").clone("cylinder" & i)
    my3d.model("cylinder" & i).addChild(model("pin" & i), #preserveParent)
    end repeat

    yogeshhungama Guest

  2. #2

    Default Re: cloneModelFromCastmember and addChild

    If this is the exact code you are using then the line

    my3d.model("cylinder" & i).addChild(model("pin" & i), #preserveParent)

    is incorrect.

    it should be

    member("my3d").model("cylinder" & i).addChild(member("my3D").model("pin" & i),
    #preserveParent)

    The 'model("pin" & i)' part needs to be an absolute path to the model. Ie you
    can't just use 'model("pin")'.

    Hope this helps

    Jonathan Pace
    [url]www.unwrong.com[/url]

    jrPace Guest

Similar Threads

  1. Limitations on Sprite .addChild()
    By Joubert Nel in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: April 14th, 01:02 AM
  2. MX:AddChild error
    By Ian Skinner in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: July 5th, 02:27 PM
  3. addChild a Shape into a UiCompo
    By bendev in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: April 13th, 12:14 PM
  4. Why can not addchild() add a child?
    By WrongAgain in forum Macromedia Director 3D
    Replies: 1
    Last Post: November 5th, 01:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139