≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
I used a script that fixes a problem related to horizontal rotations. Please modify it so it also works for vertical rotations!
Posted by:
(you are not logged in)
Enter the missing letter in: "Internation?l"
(you are not logged in)
Text:
[quote][b][/b] wrote: Thanks for your attempt, just_in_case, but I had a different idea for the invisible object. I've been trying to find a solution for this all day. I might be able to solve this problem if the "Parent" and "Child" system for Nodes would allow child objects to update their positions. Example: 1. Imagine that I have an object that's located at this position: [b]200, 0, 400[/b]. 2. Now imagine that I set that object as a child of my character's node, so it always appears directly in front of it. 3. Even though my main character moves around, and even though the Child object always appears in front of my character, its position will always be reported as [b]200, 0, 400[/b] when I use the [b]ccbGetSceneNodeProperty()[/b] function. The engine believes its position never changes, even though I see it moving around with my character! I used a behavior called "[b]Every few seconds, do something[/b]", then I set its interval to [b]1000 milliseconds[/b], and a JavaScript code inside of that behavior uses the [b]print()[/b] function to display the current position of the Child object. And, every time the current position of the Child object is reported, it always says [b]200, 0, 400[/b]! It always reports the position that the child object was located at from right before I set it as a child object! I was so close to solving our rotational problem, but this shortcoming of the Child/Parent system stopped me! I was SO close! hahaha. I wanted to use the [b]ccbAICommand()[/b] function to make the character move toward points that are always next to it, so, if i want it to rotate vertically, I would use the "[b]moveto[/b]" feature of the [b]ccbAICommand()[/b] function. It would rotate vertically forever because the Child object would always be above it, until I stop pressing the "Up" button, and the rotations would be perfect because the engine uses quaternions internally for rotations when the Artificial Intelligence features are used. The same situation would happen for all other directions. If I want my character to rotate left, I would use the "[b]moveto[/b]" feature of the [b]ccbAICommand()[/b] to move it toward the object called "LeftTurn". Since the object called "LeftTurn" is a Child object, my character would rotate left forever, because the object would always be toward its left, and it would only stop moving when I stop pressing the "Left" button. This method would be easy to achieve if Child objects would receive updated vector3D positions, but they don't. Are any of you aware of a method that can attach an object to my character's position and rotation that will also allow the engine to capture its new position? Example: If I want an object to always appear at the left side of my character, it always WILL, exactly like how the Child/Parent system works, but using the [b]ccbGetSceneNodeProperty()[/b] must also provide its new location. I also tried the Action called [b]Change position of a scene node[/b], and I set its [b]position type[/b] to [b]Set relative to a scene node[/b], and it doesn't do what I need because its X and Y and Z positions don't change along with my character's movements (they stay relative to the whole world's XYZ coordinates). As a final contingency plan, if I must cease my attempts and admit to my demise by using the "[b]First Person Shooter style controlled[/b]" Behavior, please tell me how to disable the [b]WSAD[/b] keys. I want to create my own movements. Can the WSAD keys be disabled while using the First-Person Shooter behavior? Can I free the WSAD keys so I can use them for other tasks? I appreciate the help from all of the prestigious people on this forum! I've been stressing your minds for weeks![/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact