Gabriel_Wolf Posted November 3, 2021 Share Posted November 3, 2021 Hello, I decided to finally start to learn vex. But I think now I rather suicide. Can you tell me what is wrong with this code? if (@P.y > 0){ v@Cd = set(0,1,0);}else { v@Cd = set(1,0,1);} if (v@Cd == set(0,1,0));{ v@N = 5;} So basically I what is above zero should be green. And what is green should be get a normal with value of 5. Thank you Quote Link to comment Share on other sites More sharing options...
ikoon Posted November 3, 2021 Share Posted November 3, 2021 Hi Gabor, it seems to work as expected. You can assign v@N = 5, but when doing so, you are abusing the syntax a bit. Houdini casts that 5 into a vector {5,5,5} Did you want something like this? if (@P.y > 0) { v@Cd = set(0,1,0); }else { v@Cd = set(1,0,1); } if (v@Cd == set(0,1,0)) { v@N = {0,5,0}; // I changed this line } Quote Link to comment Share on other sites More sharing options...
ikoon Posted November 3, 2021 Share Posted November 3, 2021 Or maybe you wanted this? if (@P.y > 0) { v@Cd = set(0,1,0); }else { v@Cd = set(1,0,1); } if (v@Cd == set(0,1,0)) { v@N *= 5; // this line changed } Quote Link to comment Share on other sites More sharing options...
Gabriel_Wolf Posted November 3, 2021 Author Share Posted November 3, 2021 (edited) Hello, Thank you for your help. I see the issue was I put a semicolon after this: if (v@Cd == set(0,1,0)). Edited November 3, 2021 by Gabriel_Wolf 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.