NivorbiaN Posted June 30, 2010 Posted June 30, 2010 I placed a model (node_spawns_spawn01.gmf) in a map.sbx and named it in the editor "spawn_a01" what I want to happen is when I press the "r" key, that the controller is being moved to the object i named "spawn_a01" so i type: if (KeyHit(KEY_R)) { TVec3 spawnpos; //Create a TVec3 position to store the model position EntityPosition(spawn_a01, &spawnpos); //Get position of model and store it in spawnpos. PositionEntity(g_player01, spawnpos, 1); //Position the controller at the spawn model } logic tells that spawn_a01 needs to be defined, otherwise I get a "error C2065: 'spawn_a01' : undeclared identifier" but when i define it as follows TEntity spawn_a01; i get the following compiler error ": error C2664: 'EntityPosition' : cannot convert parameter 2 from 'TVec3 *' to 'int'" probably i am thinking wrong in how I should approach this. please someone put me on the right track. Quote "Hmm, don't have time to play with myself." ~Duke Nuke'm
Canardia Posted June 30, 2010 Posted June 30, 2010 scene = LoadScene( ... ); TModel spawn_a01 = FindChild( scene, "spawn_a01" ); ... while( ... ) { ... if (KeyHit(KEY_R)) { PositionEntity(g_player01, EntityPosition(spawn_a01), 1); //Position the controller at the spawn model } } Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■
NivorbiaN Posted June 30, 2010 Author Posted June 30, 2010 My Hero!!! thanks, it did the trick. Quote "Hmm, don't have time to play with myself." ~Duke Nuke'm
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.