Home › Forums › Puzzles › Can’t trigger cloning via get distance/transform puzzle when object is moving?
- This topic has 13 replies, 3 voices, and was last updated 1 year, 1 month ago by  c4cc. c4cc.
- 
		AuthorPosts
- 
		
			
				
2024-09-18 at 4:09 am #77452 c4ccCustomer2024-09-18 at 5:03 am #77453 c4ccCustomer2024-09-18 at 5:03 am #77453 xeonCustomer xeonCustomerI 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.com2024-09-18 at 5:45 am #77457 c4ccCustomer c4ccCustomer. 
 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 FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e 2024-09-18 at 7:01 am #77459 xeonCustomer xeonCustomerHere 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.com2024-09-18 at 7:41 am #77464kdv ParticipantYou 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=sharingthe 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. 2024-09-18 at 8:21 am #77465 c4ccCustomer c4ccCustomerHere 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: FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e 2024-09-18 at 8:58 am #77467 c4ccCustomer2024-09-18 at 10:17 am #77471 c4ccCustomer2024-09-18 at 10:17 am #77471kdv ParticipantYour combination of puzzles now looks as a complete mess ))) No logic in your head – no logic in your puzzles   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. 2024-09-18 at 10:43 am #77472 c4ccCustomer c4ccCustomerXeon’s puzzles Yours that I edited credit to kdv for suggesting me these puzzles for moving player last time FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e 2024-09-18 at 10:53 am #77473kdv Participanthttps://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. 2024-09-18 at 4:23 pm #77477 xeonCustomer xeonCustomerHi 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.com2024-09-19 at 3:45 am #77478 c4ccCustomer c4ccCustomerHi 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   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] [/url]Once again, thanks for your helpful answer.   FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e 2024-09-19 at 6:51 am #77479kdv Participant5 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:       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. 2024-09-19 at 8:49 am #77485 c4ccCustomer c4ccCustomerThis works. Cloning is only done once, right, unless specified otherwise? Thanks again, I could use this code in the future for sure.   FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e 
- 
		AuthorPosts
- You must be logged in to reply to this topic.






 [/url]
[/url]