Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
So, I have a trouble with this script for a while by now, and I still can't deal with it. The point of this script was to check collision between two nodes, using their absolute position (this is needed for me), and if there is no collision - it should've draw the rectangle at the end node. If there was a collision, the rectangle should've been placed at the collision position. However, for some reason the script worcs incorrectly, and I don't know why. Here it is: var SP = ccbGetSceneNodeProperty(this.StartPoint, "PositionAbs"); If you can understand, what is the problem, can you please tell me what's wrong? |
||||
|
Code looks OK but: Draws a colored rectangle. This function can only be used inside a frame event function which must have been registered with ccbRegisterOnFrameEvent(). |
||||
|
Sven wrote: Draws a colored rectangle. This function can only be used inside a frame event function which must have been registered with ccbRegisterOnFrameEvent(). Well, this means that it is more strange, because the code I left here is a part from my full code, and this is being registered. If the code is fine, then I don't know what can be possible reason for this to work bad (not work). |
||||
|
What exactly doesnt work ? does it place rectangle in wrong location or doesnt draw it at all ? If i tested it and registred function then it did draw a rectangle at collision point. |
||||
|
|
||||
|
Huh, looks like I did it in other way, that's why it wasn't been working. I mean, I used this: behavior_collision.prototype.onAnimate = function(node, timeMs) Anyway, I'll try to use your variant, don't know will it work though. |
||||
|
Strange, I attempted to use this in behavior, but it doesn't work. Maybe because, obviously, it is a behavior... |
||||
|
Variant i used is from coppercube manual.. so it must be the correct way for doing it :D https://www.ambiera.com/coppercu... |
||||
|
lol |
||||
|
yeah, if you are into scripting then you should always check the javascript API in the documentation, it has got so many examples. |
||||
|
just_in_case wrote: yeah, if you are into scripting then you should always check the javascript API in the documentation, it has got so many examples. I am actually doing so. If you mean the JavaScript scripting reference thing. |
||||
|
Edit: this problem is solved. But the new one appeared lol I tried to make the script working, but, uhh... It says that it "Could not find property: provided scene node is invalid" (or something like that). I don't understand what am I doing wrong, but this time I'll leave the script here: /* |
||||
|
Thanks for sharing the solution I was also facing this issue since many days but finally i got the solution. Thank You so much https://spicemoneylogin.in https://myfiosgateway.one |
|