We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Can’t trigger cloning via get distance/transform puzzle when object is moving?

Home Forums Puzzles Can’t trigger cloning via get distance/transform puzzle when object is moving?

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #77452
    c4cc
    Participant

    Trying to clone walls whenever my key controlled object is at certain position.

    It works here:

    But when I move object via key controls, the cloning isn’t triggered. Why?

    #77453
    xeon
    Customer

    I believe the logic you have created will not work as you expect.

    The if statements in the lower left corner of the puzzles will only execute one time.
    If the key events did not ocurr when they were executed…nothing will happen.

    You will need to create a procedure to move the clone and have it triggered by your key event.
    There is no reason to have the “every frame” call…it will just slow stuff down.

    So on an key event….move your blue cube.
    In a procedure…test where your cube is and create the clone if conditions are met.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #77457
    c4cc
    Participant

    .
    In a procedure…test where your cube is and create the clone if conditions are met.

    I’m trying to create a player that will trigger a background object, so i need the the “every frame” call to move my player

    So how do I do this using the get position/rotation puzzle? This puzzle’s the only one that locates position of object

    #77459
    xeon
    Customer

    Here is a simplified example:
    https://v3d.net/139a.

    It contains the V3D project/puzzles and the blend file.

    You do not need an every frame call to move an object or character…but your situation may have other things involved that I am not aware of.

    Hopefully this helps.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #77464
    kdv
    Participant

    You do not need an every frame call to move an object or character

    actually, he does need that “every frame” puzzle. the perfomance impact is neglectable in that case.
    https://drive.google.com/…/view?usp=sharing

    the interval between the repetitive keydown events is too long to provide smooth moving. The interval between the first and the second keydown events is even longer (~3 times longer).

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #77465
    c4cc
    Participant

    Here is a simplified example:
    https://v3d.net/139a.

    It contains the V3D project/puzzles and the blend file.

    You do not need an every frame call to move an object or character…but your situation may have other things involved that I am not aware of.

    Hopefully this helps.

    Thanks for this, ATM looks like it works. Just had to alter this:

    • This reply was modified 3 weeks, 5 days ago by c4cc.
    #77467
    c4cc
    Participant

    On second thought, it seems that even though your solution works well, with everyframe it seems unresponsive

    greenshot

    It’s unresponsive with these:
    [/url]

    credit to kdv for suggesting me these puzzles for moving player last time

    and

    • This reply was modified 3 weeks, 5 days ago by c4cc.
    • This reply was modified 3 weeks, 5 days ago by c4cc.
    #77471
    kdv
    Participant

    Your combination of puzzles now looks as a complete mess ))) No logic in your head – no logic in your puzzles :unsure:

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #77472
    c4cc
    Participant

    Xeon’s puzzles

    greenshot

    Yours that I edited

    [/url]

    credit to kdv for suggesting me these puzzles for moving player last time

    #77473
    kdv
    Participant

    https://drive.google.com/…/view?usp=sharing

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #77477
    xeon
    Customer

    Hi there,
    Okay..so you have a situation where there are too many cooks in the kitchen.
    I was trying to answer the original topic of the thread…but it seems KDV has more of the background of what you are trying to do.

    In this case I would strongly suggest to ignore my information and continue with his input.

    As a note, the EveryFrame puzzle…doesn’t and should not be in the keydown or keyup events. This logic should be in your startup sequence as it will execute then continue to execute every frame. The testing of whether a clone should be created should still be in the key up or down events.

    Just my two cents…good luck

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #77478
    c4cc
    Participant

    Hi there,
    As a note, the EveryFrame puzzle…doesn’t and should not be in the keydown or keyup events. This logic should be in your startup sequence as it will execute then continue to execute every frame. The testing of whether a clone should be created should still be in the key up or down events.

    Just my two cents…good luck

    I’ll keep this in mind, thanks

    https://drive.google.com/…/view?usp=sharing

    :good:

    This is helpful, thanks for this. Sorry for the late reply, I was busy af last night. Now, my only 2 questions atm is, 1) how do I get the cloned wall to only appear in front of my character a few numbers away, and 2), if the wall clones more than once, any way to set the number of cloning?

    I believe the “5” in remainder of determines the location of object, while “Remainder < 5.1” and “Remainder > 4.9” determines area to clone wall.

    My variation of your answer:
    [/url]

    Once again, thanks for your helpful answer. :good:

    #77479
    kdv
    Participant

    5 is a step, an interval between clones.

    The point is to detect positions multiples of 5. The problem is that while moving your cube will never be exactly at 10, it’s position wil be ~9.999999756 or ~10.00000156 and it’s hard to catch 10 exactly. That’s why a remainder is used to catch the desired position. It should be a very small value, less than the moving step.


    this logic will trigger cloning at 0.03, 3.03, 6.03, 9.03 etc.

    My variation of your answer:

    :scratch: :wacko: :unsure:

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #77485
    c4cc
    Participant

    This works. Cloning is only done once, right, unless specified otherwise? Thanks again, I could use this code in the future for sure. :good:

    • This reply was modified 3 weeks, 4 days ago by c4cc.
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.